Frames-0.1.9: Data frames For working with tabular data files

Safe HaskellNone
LanguageHaskell2010

Frames.ColumnTypeable

Synopsis

Documentation

data Parsed a Source #

Constructors

Possibly a 
Definitely a 

Instances

Functor Parsed Source # 

Methods

fmap :: (a -> b) -> Parsed a -> Parsed b #

(<$) :: a -> Parsed b -> Parsed a #

Eq a => Eq (Parsed a) Source # 

Methods

(==) :: Parsed a -> Parsed a -> Bool #

(/=) :: Parsed a -> Parsed a -> Bool #

Ord a => Ord (Parsed a) Source # 

Methods

compare :: Parsed a -> Parsed a -> Ordering #

(<) :: Parsed a -> Parsed a -> Bool #

(<=) :: Parsed a -> Parsed a -> Bool #

(>) :: Parsed a -> Parsed a -> Bool #

(>=) :: Parsed a -> Parsed a -> Bool #

max :: Parsed a -> Parsed a -> Parsed a #

min :: Parsed a -> Parsed a -> Parsed a #

Show a => Show (Parsed a) Source # 

Methods

showsPrec :: Int -> Parsed a -> ShowS #

show :: Parsed a -> String #

showList :: [Parsed a] -> ShowS #

class Parseable a where Source #

Values that can be read from a Text with more or less discrimination.

Methods

parse :: MonadPlus m => Text -> m (Parsed a) Source #

Returns Nothing if a value of the given type can not be read; returns 'Just Possibly' if a value can be read, but is likely ambiguous (e.g. an empty string); returns 'Just Definitely' if a value can be read and is unlikely to be ambiguous."

parse :: (Readable a, MonadPlus m) => Text -> m (Parsed a) Source #

Returns Nothing if a value of the given type can not be read; returns 'Just Possibly' if a value can be read, but is likely ambiguous (e.g. an empty string); returns 'Just Definitely' if a value can be read and is unlikely to be ambiguous."

discardConfidence :: Parsed a -> a Source #

Discard any estimate of a parse's ambiguity.

parse' :: (MonadPlus m, Parseable a) => Text -> m a Source #

Acts just like fromText: tries to parse a value from a Text and discards any estimate of the parse's ambiguity.

class ColumnTypeable a where Source #

This class relates a universe of possible column types to Haskell types, and provides a mechanism to infer which type best represents some textual data.

Minimal complete definition

colType, inferType

Methods

colType :: a -> Q Type Source #

inferType :: Text -> a Source #