How to I define the equivalent of this function (taken from learnyouahaskell) inside GHCi?
import Data.List
numUniques :: (Eq a) => [a] -> Int
num
The GHC User's Guide shows two additional ways to achieve this. This subsection introduces the :{ ... :} construct, which can be used as follows:
> :{
| numUniques :: (Eq a) => [a] -> Int
| numUniques = length . nub
| :}
Alternatively, you can enable multiline mode:
> :set +m
> let
| numUniques :: (Eq a) => [a] -> Int
| numUniques = length . nub
|