Haskell Tips (@HaskellTips) profile picture

Tips, tricks and hacks by @jfischoff

Joined January 2014
So apparently a lot of peeps still don't know you can avoid pressing 'up' a billion times going through :reload's in GHCi by adding this to your `~/.haskeline` file: historyDuplicates: IgnoreAll Have fun.
3
21
103
Haskell Tips retweeted
Open this page: hackage.haskell.org/package/… ... and then type 's' to open a quick search for any exported symbols in lens
9
23
5
65
Haskell Tips retweeted
WARNING: advanced haskell tips
3
45
2
119
Haskell Tips retweeted
#Haskell pro-tip: module A(module A) is equivalent to module A; useful if you want to export everything and reexport imported decls
1
3
6
Haskell Tips retweeted
`ExceptT` forms two monads. Take the monad laws and replace `return` with `throwE` and `(>>=)` with `catchE` and the laws still work.
2
4
7
Enable the #Haskell GHCi multiline setting in your ~/.ghci file: downloads.haskell.org/~ghc/7… (or just know about the :{ command)
1
7
16
Replying to @HaskellTips
@HaskellTips don’t forget `error`
1
1
Haskell Tips retweeted
Consider using -fwarn-incomplete-uni-patterns for even more safety at compile time. CC @HaskellTips
2
3
Haskell Tips retweeted
Replying to @HaskellTips
@HaskellTips Wrt objects, I think it’s more accurate to say that type constructors map types to types. Maybe :: * -> *
1
2
1
Haskell Tips retweeted
Replying to @HaskellTips
@HaskellTips Always enable ScopedTypeVariables to do this: do (x :: SomeType) <- someComp ... Very useful for debugging monadic code.
1
1
3
Replying to @HaskellTips
@HaskellTips [A..D] parses incorrectly as a qualified . operator from module A; see ghc.haskell.org/trac/haskell… or just write [A .. D].
1
1
Haskell Tips retweeted
Replying to @HaskellTips
@HaskellTips It does complain about some partial pattern matches in do-notation. "do getArgs; return ()" generates a warning with -Wall.