Evil Haskell Tips

266 posts

Evil Haskell Tips

Evil Haskell Tips

@EvilHaskellTips

go forth, my statically typed minions. Eval! Apply!

가입일 Ocak 2014
18 팔로잉2.7K 팔로워
Evil Haskell Tips 리트윗함
Mark
Mark@mwotton·
Mark tweet media
ZXX
1
2
8
575
Evil Haskell Tips
Evil Haskell Tips@EvilHaskellTips·
“Semigroup” and “Monoid” are exclusionary terminology. Prefer “smashy-smashy” and “smashy-smashy-with-extra-nothing”.
English
1
11
76
4.5K
Evil Haskell Tips
Evil Haskell Tips@EvilHaskellTips·
Create a Brobdingnagian monstrosity of 1.2m lines of Haskell. That way, the tooling you create to make working on it tolerable will be practically instant on codebases that don’t need 18 lanes for a 3 point turn. (With love and appreciation, @mercury)
English
1
1
12
1.1K
Evil Haskell Tips
Evil Haskell Tips@EvilHaskellTips·
@kerckhove_ts This does have the flavour of “an ethical engineer would never write a procedure ‘destroyBaghdad’ - it should take a city as a parameter”
English
0
0
2
43
Evil Haskell Tips
Evil Haskell Tips@EvilHaskellTips·
Tired of probabilistic correctness guarantees? instance Arbitrary UUID where … shrink uuid = case UUID.toWords uuid of (a,b,c,d) -> [UUID.fromWords a' b' c' d' | a' <- sw a, b' <- sw b, c' <- sw c, d' <- sw d] where sw w = take 10 $ iterate (`div` 2) w
English
1
0
1
1.2K
Tom Sydney Kerckhove
Tom Sydney Kerckhove@kerckhove_ts·
@EvilHaskellTips This will generate an unreasonable number of the same UUID values for small word values. You want to filter out the extra zero values in `sw`, I think.
English
2
0
0
142
Evil Haskell Tips
Evil Haskell Tips@EvilHaskellTips·
Performance tip: s/sequence/mapConcurrently/g Good code can be run in any order.
English
2
0
10
1.2K
Evil Haskell Tips
Evil Haskell Tips@EvilHaskellTips·
The great thing about using Haskell with LLMs is that you can be absolutely precise about the nonsense you are ingesting and emitting.
English
0
0
9
773
Evil Haskell Tips
Evil Haskell Tips@EvilHaskellTips·
@DRMacIver has pointed out that Hypothesis will report all the assertions that fail rather than just the first. A decadent affordance to be avoided by the faithful.
English
0
0
2
499
Evil Haskell Tips
Evil Haskell Tips@EvilHaskellTips·
Yes, it will be extremely difficult to follow what's going on as the counterexample-finding algorithm dances between the different assertions. This is by design, and will help you back into the divine light of Writing Correct Code The First Time.
English
1
1
10
943
Evil Haskell Tips
Evil Haskell Tips@EvilHaskellTips·
Testing is for programmers lacking the moral fibre to prove every useful property about their code in the type system.
English
1
3
20
1.4K
Evil Haskell Tips
Evil Haskell Tips@EvilHaskellTips·
If you're writing a parser for some type t, one fun thing to omit is a way to turn it back into a string. Easy visualisation, canonicalisation and roundtrip properties are for people who insist on putting bugs in their code and there is no reason to coddle them.
English
0
0
6
665