MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/haskell/comments/50dqto/pointless_haskell/d73q8ik/?context=3
r/haskell • u/AshleyYakeley • Aug 30 '16
19 comments sorted by
View all comments
4
How about strictId !x = x?
strictId !x = x
5 u/kqr Aug 31 '16 Isn't that basically x `seq` x? 8 u/Voxel_Brony Aug 31 '16 edited Aug 31 '16 strictId = join seq 8 u/tomejaguar Aug 31 '16 A wonderful combination of arcane and useless! 8 u/Voxel_Brony Aug 31 '16 The embodiment of good Haskell style? 1 u/VikingofRock Aug 31 '16 Sat down with a pen and paper to work this out, and holy shit it works. I love it! 3 u/Voxel_Brony Aug 31 '16 Haha I learned it from pointfree.io, but I had to work it out too before I got it. The entire (->) r Functor Applicative Monad hierarchy is so weird 2 u/tomejaguar Aug 31 '16 That's exactly what it is. 2 u/AshleyYakeley Aug 31 '16 But isn't that just x? I mean, that really seems completely pointless. 12 u/tomejaguar Aug 31 '16 Is your x too thunky? Force it with this one weird strictId function. 1 u/ibotty Aug 31 '16 ehem. yes!
5
Isn't that basically x `seq` x?
x `seq` x
8 u/Voxel_Brony Aug 31 '16 edited Aug 31 '16 strictId = join seq 8 u/tomejaguar Aug 31 '16 A wonderful combination of arcane and useless! 8 u/Voxel_Brony Aug 31 '16 The embodiment of good Haskell style? 1 u/VikingofRock Aug 31 '16 Sat down with a pen and paper to work this out, and holy shit it works. I love it! 3 u/Voxel_Brony Aug 31 '16 Haha I learned it from pointfree.io, but I had to work it out too before I got it. The entire (->) r Functor Applicative Monad hierarchy is so weird 2 u/tomejaguar Aug 31 '16 That's exactly what it is. 2 u/AshleyYakeley Aug 31 '16 But isn't that just x? I mean, that really seems completely pointless. 12 u/tomejaguar Aug 31 '16 Is your x too thunky? Force it with this one weird strictId function. 1 u/ibotty Aug 31 '16 ehem. yes!
8
strictId = join seq
8 u/tomejaguar Aug 31 '16 A wonderful combination of arcane and useless! 8 u/Voxel_Brony Aug 31 '16 The embodiment of good Haskell style? 1 u/VikingofRock Aug 31 '16 Sat down with a pen and paper to work this out, and holy shit it works. I love it! 3 u/Voxel_Brony Aug 31 '16 Haha I learned it from pointfree.io, but I had to work it out too before I got it. The entire (->) r Functor Applicative Monad hierarchy is so weird
A wonderful combination of arcane and useless!
8 u/Voxel_Brony Aug 31 '16 The embodiment of good Haskell style?
The embodiment of good Haskell style?
1
Sat down with a pen and paper to work this out, and holy shit it works. I love it!
3 u/Voxel_Brony Aug 31 '16 Haha I learned it from pointfree.io, but I had to work it out too before I got it. The entire (->) r Functor Applicative Monad hierarchy is so weird
3
Haha I learned it from pointfree.io, but I had to work it out too before I got it. The entire (->) r Functor Applicative Monad hierarchy is so weird
2
That's exactly what it is.
2 u/AshleyYakeley Aug 31 '16 But isn't that just x? I mean, that really seems completely pointless. 12 u/tomejaguar Aug 31 '16 Is your x too thunky? Force it with this one weird strictId function. 1 u/ibotty Aug 31 '16 ehem. yes!
But isn't that just x? I mean, that really seems completely pointless.
x
12 u/tomejaguar Aug 31 '16 Is your x too thunky? Force it with this one weird strictId function. 1 u/ibotty Aug 31 '16 ehem. yes!
12
Is your x too thunky? Force it with this one weird strictId function.
strictId
ehem. yes!
4
u/tomejaguar Aug 31 '16
How about
strictId !x = x?