minus-squareLilac [she/her]@lemmygrad.mltoMemes@lemmy.ml•6÷2(1+2)linkfedilinkarrow-up1·1 year agoKinda. You can’t define a name, but you can get the compiler to interpret literals as a function. If you have a Num instance for (Integer -> Integer) where, fromInteger i = \x -> x * i the compiler can interpret integer literals as functions like so x = 2(5) :: Integer linkfedilink
Kinda. You can’t define a name, but you can get the compiler to interpret literals as a function. If you have a Num instance for (Integer -> Integer) where,
fromInteger i = \x -> x * i
the compiler can interpret integer literals as functions like so
x = 2(5) :: Integer