Find it here: https://github.com/bitemyapp/learnhaskell
位> import Unsafe.Coerce | |
位> let isJust' = unsafeCoerce :: Maybe a -> Bool | |
位> isJust' $ Just 1 | |
True | |
位> isJust' $ Nothing | |
False |
heap stuff | |
trailing slashes in URLs are the bane of programmer sanity | |
docstrings | |
helps if you add the bloody migration | |
merged | |
inheritance is copy-pasta | |
persona | |
decent start | |
well that was unnecessary | |
god dammit mixpanel |
08:01 < prophile> unsafePerformIO is such an unwieldy name, I think it should be called 'run' | |
08:01 < bitemyapp> prophile: evil haskell tip | |
08:01 < bitemyapp> prophile: alias unsafePerformIO to run so you can use it more. |
Debugging is reification of manual and tedious imperative traversal of logic.
Don't debug.
Decompose and interrogate - coarse and fine.
位> let blah = 1 | |
位> let blah = 2 | |
位> blah | |
2 | |
位> let blah x = x | |
位> blah 1 | |
1 | |
位> :t blah | |
blah :: t -> t | |
位> let (blah x = x) :: Int -> Int |
Play Framework vs. the relative messiness of Yesod/Snap/Happstack/Scotty/raw WAI. Clojure has a similar (to Haskell's) story here. I'm understating it here, but this is pretty big. Most web applications are not special snowflakes, a framework to wrap-up common-case nonsense concisely is very valuable. Micro-framework stacks like using WAI directly or Scotty are good to have, but insufficient.
Specialized NLP libraries (in Java, at present) such as for medical lexicons. Might be replicable by being layered on top of existing Haskell NLP libs, but doesn't yet exist to my knowledge. Hardening up libraries like this usually takes a lot of time.
Slick is nicer and easier to get started with than Persistent. Partly due to documentation, partly because Slick isn't silly and embraces relational databases directly, partly because Persistent is just kind of hairy. Supporting MongoDB isn't a plus, it's a minus. Compromises the API anyway.
A migrations library of pretty much any sort at all.
Scala/xml equivalent i
import Control.Lens | |
dna = "CCATATGGGACGAATCAAAGGTTTGCCAATCACCCAAATGTCCAGTGAGGATAACGAAGACATTACGCCACCCTAGTATGAGGGCTTTATTTCGGAATAACTCTTATACTGCCATCCTGTACCACGGGGATCATAATTAAGGATCCAAGGTTAGAACGGGTTCCCCCGACGGGGCCACAACTTCCTCGCCTAGCACTCCTGCGGTCTCACGCATAAGGCACATACGAGCTGAGAAAGGGTACACCTCATGAAATGAGCGGCGACCCGCATCACCGTACTGCGCTGATCCGCAACCATTCGAAAATGATCTGGTCATCTGGGTTGTAAAACCTCGCTTGGCGGCCCGTCAGGCAAGTCGCTCATATGAACTACGCTCAGCGGCCCCTGGAGTGGTCGTGTGTCGAGTATGTGGGAGAAACACTAGGGCCATCCTTGCTAACACCACGCCGAGACAAGTTGCTTGAGCAGTTACGGTGTGCCTTGAATTCTGTGGAAGAACAGAGTGCGAGGCTGCATAGTCAGTAGAATTAGGCCTGCAGGTGCCGTCACTAATTTGATATCAGTCCAGCCACGGCGTTTGAATACAATGTTGTCGAGCCTCATCCCGACACCATGAGATCGTGAGCACTGTACAGTCTCCAGACAGATGTCATTGGTTTTCTGGGTTTCAGTTAGTCCCTTAGTACGGTCTGGAACACACCTACACCGGGCAATCTCGGTCACTAGCTAGTAATAAACGGTCGTTGCCGGCATGGTGTCTTGCTGCGGAAAGAGTCCGTTGTGTAGAGTAACTCGAAATCGCCTATAAATCCAAATCTCCGAGACCGCCCGCGACTGCATTGTTATATAC" | |
data Nucleobase = A | G | C | T | |
data Counter = Counter {_a :: Int, _g :: Int, _c :: Int, _t :: Int} deriving (Show) | |
makeLenses ''Counter | |
pickN |
I need to normalize relative ordering of the contents of an array into something that can be efficiently indexed and queried against.
Given data: [".content", "blah", "woo"] that should be discovered by a query ".content" FOLLOWED_BY "woo"
Note the sparseness. It's contingent on the relative ordering of the elements, not the absolute values of the indexes.
I'm trying to figure out if there's a way to represent the relative ordering as neatly indexable, absolute values.
To index these relative positions I would have to index an explosion of paired off values. [".content", "blah", "woo"] would return into (".content", "blah", OBJ_ID), (".content", "woo", OBJ_ID), ("blah", "woo", OBJ_ID).
[callen@localhost ~/code/lambdabot-4.3.0.1]$ cabal install -v2 --max-backjumps=-1 | |
Using a sandbox located at /Users/callen/code/lambdabot-4.3.0.1/.cabal-sandbox | |
Reading available packages... | |
Reading available packages... | |
Reading installed packages... | |
'/usr/bin/ghc-pkg' 'dump' '--package-db=/Users/callen/code/lambdabot-4.3.0.1/.cabal-sandbox/x86_64-osx-ghc-7.6.3-packages.conf.d' '-v0' | |
'/usr/bin/ghc' '--print-libdir' | |
Reading available packages... | |
Choosing modular solver. | |
Resolving dependencies... |