on master help sign in
fix some datatypes docs formatting
commit0a19140bc71834ec9472d63c3fc9a8313615d7fe authorAgentM <agentm@tanyas-imac.local> dateSat 1 Apr 2017, 23:01 (10 years ago) parent2c0105a
1 file changed+6−4
docs/new_datatypes.markdown+6−4
docs/new_datatypes.markdown+6−4
@@ -93,14 +93,16 @@ TIO.putStrLn (showRelation peopleRel)
9393└──────────┴──────────┘
9494```
9595
96+Note here that ```Blond``` is not quoted because it is not a text value, but rather a real algebraic data type constructor honored by the database. The value is not a black box nor is an enumeration. Try, for example, replacing the ```Blond``` value with an ```OtherColor "Black"``` value to see how it appears and can be matched as well.
97+
9698The essential ```Atomable``` typeclass functions are:
9799
98100| Function | Purpose |
99101| -------- | ------- |
100−| toAtom :: a -> Atom | convert a Haskell data type to a database atom |
101−| fromAtom :: Atom -> a | convert a database atom to a Haskell data type |
102−| toAtomType :: a -> AtomType | generate a database AtomType for a Haskell datatype |
103−| toDatabaseContextExpr :: a -> DatabaseContextExpr | generate a ```DatabaseContextExpr``` which can be executed against a database context in order to add the new type |
102+| ```toAtom :: a -> Atom``` | convert a Haskell data type to a database atom |
103+| ```fromAtom :: Atom -> a``` | convert a database atom to a Haskell data type |
104+| ```toAtomType :: a -> AtomType``` | generate a database AtomType for a Haskell datatype |
105+| ```toDatabaseContextExpr :: a -> DatabaseContextExpr``` | generate a ```DatabaseContextExpr``` which can be executed against a database context in order to add the new type |
104106
105107In addition, basic Haskell data types like ```Int```, ```Text```, ```Bool```, ```UTCTime```, and more already have Atomable instances ready-to-go.
106108