Haskell Tips
@HaskellTips
Tips, tricks and hacks by @jfischoff
قد يعجبك
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.
Open this page: hackage.haskell.org/package/lens ... and then type 's' to open a quick search for any exported symbols in lens
Usually one starts with the first error and works forward. With the default setting one has to scroll up over and over again.
Use `ghci -freverse-errors` or `stack repl --ghc-options=-freverse-errors` to reverse the error order; see the first error with no scrolling
() does not add a “null” value to every type, hell no; () is a “dull” value in a type of its own: () - @pigworker personal.cis.strath.ac.uk/conor.mcbride/…
Avoid lengthy computation in a exception handler with `catch`. The exception handler has async exceptions masked: hackage.haskell.org/package/base-4…
Careful with your foralls data A = forall a. A {x :: a} -- existential quantification data A = A {x :: forall a. a} -- polymorphic component
YMMV
I've only found it necessary on 7.10, the parallel gc bugs seem to be mostly fixed in >= 8.0
Use the '+RTS -qg' flag to speed up your programs. /ht @stdlib inner-haven.net/posts/2017-05-…
IORef can't unbox primitives, but URef, Ptr and others can and are thus faster: medium.com/@jonathangfisc…
class ToB a where to∷a → B class FromB a where from∷Parser a -- vs class Bable a where to∷a → B from∷Parser a medium.com/@jonathangfisc…
(Pattern Matching : Data Constructors :: Type Class Instance Selection : Type Constructors) / ordering medium.com/@jonathangfisc…
If you are using `putStr` you probably want to > import System.IO > hSetBuffering stdout NoBuffering
Data.List.\\ doesn't remove duplicates: > import Data.List > [1, 1, 2] \\ [1, 2] [1] For set difference use Data.Set.\\
If you want to run a function from the command line: > echo 'foo "hello"' | ghci src/File.hs If you want to run `main`: > runhaskell Main.hs
To list all @Hackage packages > cabal list With just the word "lens" > cabal list lens For a summary of the package 'lens' > cabal info lens
United States الاتجاهات
- 1. Lakers 57.8K posts
- 2. Luka 57.8K posts
- 3. Wemby 22.6K posts
- 4. Marcus Smart 4,472 posts
- 5. #LakeShow 4,654 posts
- 6. Blazers 6,828 posts
- 7. Richard 45.2K posts
- 8. Ayton 11.5K posts
- 9. Horford 1,614 posts
- 10. Westbrook 8,962 posts
- 11. #RipCity N/A
- 12. #AEWDynamite 19.3K posts
- 13. Podz 2,259 posts
- 14. Champagnie 1,156 posts
- 15. #AmphoreusStamp 4,273 posts
- 16. Kuminga 3,150 posts
- 17. Spencer Knight N/A
- 18. Thunder 31.3K posts
- 19. #Survivor49 3,290 posts
- 20. Deni 6,004 posts
قد يعجبك
-
Edward Kmett
@kmett -
Well-Typed
@welltyped -
gabby
@GabriellaG439 -
Neil Mitchell (neildmitchell @🪡)
@ndm_haskell -
Tweag by Modus Create
@tweagio -
João Forte Carvalho @Conste11ation
@bgamari -
Andres Löh
@kosmikus -
Michael Snoyman
@snoyberg -
Nikita Volkov
@NikitaYVolkov -
Phil Freeman
@paf31 -
ICFP Conference
@icfp_conference -
Matt Parsons
@mattoflambda -
Tikhon Jelvis
@tikhonjelvis -
gelisam
@haskell_cat
Something went wrong.
Something went wrong.