Safe Haskell | None |
---|---|
Language | Haskell2010 |
- contramapContent :: forall c1 c2 f a. Contravariant f => (c2 -> c1) -> Decoding f c1 a -> Decoding f c2 a
- headless :: (content -> Either String a) -> Decoding Headless content a
- headed :: content -> (content -> Either String a) -> Decoding Headed content a
- indexed :: Int -> (content -> Either String a) -> Decoding (Indexed Headless) content a
- maxIndex :: forall f c a. Decoding (Indexed f) c a -> Int
- uncheckedRunWithRow :: Int -> Decoding (Indexed f) content a -> Vector content -> Either (DecodingRowError f content) a
- uncheckedRun :: forall content a f. Decoding (Indexed f) content a -> Vector content -> Either (DecodingCellErrors f content) a
- headlessToIndexed :: forall c a. Decoding Headless c a -> Decoding (Indexed Headless) c a
- length :: forall f c a. Decoding f c a -> Int
- headedToIndexed :: forall content a. Eq content => Vector content -> Decoding Headed content a -> Either (HeadingErrors content) (Decoding (Indexed Headed) content a)
- prettyError :: (c -> String) -> DecodingRowError f c -> String
- prettyRowError :: (content -> String) -> RowError f content -> (String, [String])
- prettyCellErrors :: (c -> String) -> DecodingCellErrors f c -> [String]
- prettyHeadingErrors :: (c -> String) -> HeadingErrors c -> [String]
- columnNumToLetters :: Int -> String
Documentation
contramapContent :: forall c1 c2 f a. Contravariant f => (c2 -> c1) -> Decoding f c1 a -> Decoding f c2 a Source
Converts the content type of a Decoding
. The
constraint means that Contravariant
ff
can be Headless
but not Headed
.
uncheckedRunWithRow :: Int -> Decoding (Indexed f) content a -> Vector content -> Either (DecodingRowError f content) a Source
This function uses unsafeIndex
to access
elements of the Vector
.
uncheckedRun :: forall content a f. Decoding (Indexed f) content a -> Vector content -> Either (DecodingCellErrors f content) a Source
:: Eq content | |
=> Vector content | Headers in the source document |
-> Decoding Headed content a | Decoding that contains expected headers |
-> Either (HeadingErrors content) (Decoding (Indexed Headed) content a) |
Maps over a Decoding
that expects headers, converting these
expected headers into the indices of the columns that they
correspond to.
prettyError :: (c -> String) -> DecodingRowError f c -> String Source
This adds one to the index because text editors consider line number to be one-based, not zero-based.
prettyCellErrors :: (c -> String) -> DecodingCellErrors f c -> [String] Source
prettyHeadingErrors :: (c -> String) -> HeadingErrors c -> [String] Source
columnNumToLetters :: Int -> String Source