1module ProjectM36.Atom where
4import qualified Data.Text as T
5--import Data.Time.Calendar
6--import Data.Time.Clock
7--import Data.ByteString (ByteString)
10relationForAtom :: Atom -> Either RelationalError Relation
11relationForAtom (RelationAtom rel) = Right rel
12relationForAtom _ = Left $ AttributeIsNotRelationValuedError ""
14atomToText :: Atom -> T.Text
15atomToText (IntegerAtom i) = (T.pack . show) i
16atomToText (IntAtom i) = (T.pack . show) i
17atomToText (DoubleAtom i) = (T.pack . show) i
18atomToText (TextAtom i) = (T.pack . show) i --does this break quoting in CSV export?
19atomToText (DayAtom i) = (T.pack . show) i
20atomToText (DateTimeAtom i) = (T.pack . show) i
21atomToText (ByteStringAtom i) = (T.pack . show) i
22atomToText (BoolAtom i) = (T.pack . show) i
23atomToText (IntervalAtom b e bo be) = beginp <> begin <> "," <> end <> endp
24 where beginp = if bo then "(" else "["
27 endp = if be then ")" else "]"
29atomToText (RelationAtom i) = (T.pack . show) i
30atomToText (ConstructedAtom dConsName _ atoms) = dConsName <> dConsArgs
32 parensAtomToText a@(ConstructedAtom _ _ []) = atomToText a
33 parensAtomToText a@ConstructedAtom{} = "(" <> atomToText a <> ")"
34 parensAtomToText a = atomToText a
36 dConsArgs = case atoms of
38 args -> " " <> T.intercalate " " (map parensAtomToText args)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list