This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Some code excerpts to illustrate the following question: | |
| -- Why is the type ascription | |
| -- | |
| -- :: forall eff. ContT _ _ [F Number] | |
| -- | |
| -- below necessary? Why isn't `[F a]` inferred to be `[F Number]` from | |
| -- our use of `:: Query a` in the call to `runQueryCont`? | |
| -- My assumption: choosing a `Query a` fixes `a` as well as the `[F a]` in the result type | |
| runQueryCont :: forall eff a rxx. (IsForeign a) => Query a -> Client -> ContT rxx (DBEff eff) [F a] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun purescript-pursuit-search (query-str) | |
| "Search Pursuit for given search string" | |
| (browse-url (concat "http://pursuit.purescript.org/?q=" query-str)) | |
| ) | |
| ;; TODO | |
| ;; - use symbol at point as default query? | |
| ;; - simply called 'hoogle' and 'hayoo' in haskell-mode | |
| ;; - browse *inside* emacs? | |
| ;; - case sensitivity? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- | The `partition` function takes a predicate and a list, and returns the pair | |
| -- | of lists of elements which do and do not satisfy the | |
| -- | predicate, respectively. | |
| -- | | |
| -- | ```purescript | |
| -- | partition (< 3) [1,2,3,4,5] == Tuple ([1,2]) ([3,4,5]) | |
| -- | ``` | |
| partition :: forall a. (a -> Boolean) -> [a] -> Tuple [a] [a] | |
| partition p xs = foldr (select p) (Tuple [] []) xs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "uploader": null, | |
| "packageMeta": { | |
| "moduleType": [ | |
| "node" | |
| ], | |
| "repository": { | |
| "url": "git://github.com/epost/purescript-node-postgres.git", | |
| "type": "git" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; TODO | |
| ;; - Use temp files so emacs can write the current buffer status to an intermediate save file | |
| ;; and have pulp compile that. This way, flycheck doesn't have to wait until the user | |
| ;; saves the buffer manually, and provide *actual* on-the-fly checking. | |
| ;; | |
| ;; - Format links to error explanations on purescript wiki nicely. | |
| ;; adapted from https://github.com/spion/purscheck/blob/master/purscheck.el | |
| (eval-after-load 'flycheck | |
| '(progn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| joinTraverse f m = fmap join (traverse f m) |
IDEs, and programming language tools in general, translate software facts (obtained from source code, library definitions, object files, etc.) and user input to other useful forms, such as editor or compiler actions, and diagrams. My proposal:
- Separate queries and commands
- query examples:
- find location of definition of
foo - find all locations that
reference fromMaybe - find all possible completions at some location (e.g. my cursor):
completions <FILE> <LINE> <COL>
- find location of definition of
- command examples:
- query examples:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "module": "Data.Array", | |
| "identifier": "filter", | |
| "type": "forall a. (a -> Boolean) -> Array a -> Array a" | |
| }, | |
| { | |
| "module": "Data.Array", | |
| "identifier": "map", | |
| "type": "forall a b. (a -> b) -> Array a -> Array b" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Animal { | |
| def makeSound() = "Hi! I weigh " + weight | |
| val weight = 15.5 | |
| } | |
| class Dog extends Animal { | |
| override def makeSound() = "woof!" | |
| override val weight = 2.0 | |
| } |