This means "export all constructors and write fields for this data type."
When writing a module export list, there are 4 ways to export a data type:
module ModuleD(
D,
D(..),
D(DA)
) where
data D = DA A | DB B
, , , , , . , , , :
module Even (evenInt, toInt) where
newtype EvenInt = EvenInt Int deriving (Show, Eq)
evenInt :: Int -> Maybe EvenInt
evenInt x = if x `mod` 2 == 0 then Just x else Nothing
toInt :: EvenInt -> Int
toInt (EvenInt x) = x
, :
x = evenInt 2
putStrLn $ if isJust x then show . toInt . fromJust $ x else "Not even!"
toInt :
data EvenInt = EvenInt { toInt :: Int }
4 . @leftaroundabout