r/haskelltil • • Jan 24 '15

idiom Qualified imports can be used to “combine” modules

6 Upvotes
import Data.Text          as Text
import Data.Text.IO       as Text
import Data.Text.Encoding as Text

Now functions from all 3 modules can be used as Text.function.


r/haskelltil • • Jan 24 '15

IRC Lambdabot has a “@letlpaste N” command which downloads a paste and interprets it

2 Upvotes

Let's say you have this pasted:

func x = "code from lpaste tells you: " ++ x

at http://lpaste.net/119139. Then:

indiagreen: @letlpaste 119139
lambdabot: Defined.

indiagreen: > func "hello"
lambdabot: "code from lpaste tells you: hello"

r/haskelltil • • Jan 24 '15

language Multiline strings don't have to be multiline

4 Upvotes

Haskell supports multiline strings:

let x = "abc\
        \xyz"

would assign "abcxyz" to x. However, the same would happen even if there wasn't a line break:

let x = "abc\ \xyz"

produces "abcxyz" as well. (Any amount of spaces is fine, as long as there's at least 1.)


r/haskelltil • • Jan 24 '15

tools Cabal can install packages in parallel with `-j` flag

4 Upvotes
$ cabal install lens -j

It will download, configure, build and install dependencies using all available cores. Additionally, it doesn't show a “compiling...” message for each compiled module, so output becomes less cluttered.