1 {-# LANGUAGE OverloadedStrings #-}
3 module Text.Edifact.Scaffolder.Simples.Implementation
8 import Text.Edifact.Scaffolder.Commons
9 import Text.Edifact.Scaffolder.Simples.Types
13 toImplementation :: Representation -> Text
14 toImplementation (Representation content (UpTo n) ) = sformat (fContent % " `upTo` " % int) content n
15 toImplementation (Representation content (Exactly n)) = sformat (fContent % " `exactly` " % int) content n
16 toImplementation (Representation content AnyNumber ) = sformat ("many " % fContent) content
18 fContent :: Format t (Content -> t)
20 let display AlphaNumeric = "alphaNumeric"
21 display Alpha = "alpha"
22 display Numeric = "numeric"