MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/purescript/comments/73uwdx/this_seems_surprising/
r/purescript • u/mjhoy • Oct 02 '17
> not unit == unit true
5 comments sorted by
3
Not if you consider that the subexpression not unit evaluates to unit.
not unit
unit
3 u/mjhoy Oct 02 '17 I think the more surprising thing is that not works with unit. Yes, I understand it’s a HeytingAlgebra thing but... still surprising. 4 u/paf31 Oct 02 '17 Unit has lots of instances, since it's the trivial version of many structures.
I think the more surprising thing is that not works with unit. Yes, I understand it’s a HeytingAlgebra thing but... still surprising.
4 u/paf31 Oct 02 '17 Unit has lots of instances, since it's the trivial version of many structures.
4
Unit has lots of instances, since it's the trivial version of many structures.
Unit
2
unit is a minimally inhabited type (it has a single valid construction) so any function closed over that singleton set returns the same value.
not super useful, but i could see some reasoning behind it haha
3 u/[deleted] Oct 03 '17 not super usefulEven non-functional languages had to come up with their void ;)
not super useful
Even non-functional languages had to come up with their void ;)
void
3
u/paf31 Oct 02 '17
Not if you consider that the subexpression
not unitevaluates tounit.2
u/fredugolon Oct 02 '17
unit is a minimally inhabited type (it has a single valid construction) so any function closed over that singleton set returns the same value.
not super useful, but i could see some reasoning behind it haha