
Hi, Playing around with code (very few lines) that represents long-form articles. I'd like to understand: 1- if the usage of `type' is correct, or if I should prefer `newtype', or something different altogheter. 2- what's the more idiomatic way to do the boxing and unboxing of renamed types? See last 2 functions in the code. import Data.Time (Day) import Data.List (intercalate) import Data.List.Split (splitOn) type Title = String type Author = String type Sentence = String type Paragraph = [Sentence] type Abstract = Paragraph type Content = [Paragraph] type Date = Day data Essay = Essay { title :: Title , authors :: [Author] , pubDate :: Date , startDate :: Date , abstract :: Abstract , content :: Content } deriving (Show) makeTitle :: String -> Title makeTitle x = x::Title makePar :: String -> Paragraph makePar = splitOn sep where sep = "." makeContent :: String -> Content makeContent x = map makePar $ splitOn sep x where sep = "\n\n" unboxPar :: Paragraph -> String unboxPar = intercalate ". " unboxContent :: Content -> String unboxContent x = intercalate "\n\n" $ map unboxPar x Thanks, Pete