Normally in Haskell, tuples of length one aren't allowed (AFAIK). However, when messing with Template Haskell, I got this:
oneElementTuple = $(do{
x <- newName "x";
return $ LamE
[VarP x]
(TupE [Just (VarE x)]) -- one element tuple?
})
GHCi tells me that oneElementTuple
is of type a -> Unit a
. I couldn't find any documentation on this Unit
type, and it doesn't seem to be an instance of any basic typeclasses like Show
or Functor
. So, where is Unit
defined, if it isn't just built-in magic? Is it at all useful?