drasil-code-0.1.9.0: A framework for code and document generation for scientific software - Code SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Code.DataDesc

Synopsis

Documentation

type DataItem = CodeVarChunk Source #

A DataItem is just a CodeVarChunk (a piece of data).

data DataDesc' Source #

A data description either has data connected to other pieces of data, or a single piece of data.

data Data' Source #

Constructors

Datum DataItem'

Single data item. | To be used in cases where multiple list-type data have their elements intermixed, and thus need to be described together.

Data (NonEmpty DataItem') Integer Delimiter 
Junk

Data that can be ignored/skipped over.

data DataItem' Source #

A piece of data that contains the datum described and delimeters between elements. The size of the list of delimiters should be equal to the dimension of datum.

Constructors

DI CodeVarChunk [Delimiter] 

type Delimiter = String Source #

Delimiter between elements of data.

dataDesc :: [Data'] -> Delimiter -> DataDesc' Source #

Organize a list of data with a given Delimiter into a DataDesc'.

singleton' :: CodeVarChunk -> Data' Source #

Constructor for creating a single datum.

list :: CodeVarChunk -> [Delimiter] -> Data' Source #

Constructor for creating data from a description of the data and a list of delimiters with a size equal to the dimension.

interwovenLists :: [DataItem'] -> Integer -> Delimiter -> Data' Source #

Weaves elements of data together given a list of data items, a degree of intermixing, and a delimiter for the data.

junk :: Data' Source #

Constructor for data that should be skipped.

type DataDesc = [Data] Source #

Older version of DataDesc'. Holds a list of Data'.

type Delim = Char Source #

Older version of Delimiter. Holds a Char.

data Data Source #

Older version of Data'.

Constructors

Singleton DataItem

Single datum.

JunkData

Junk data (can be skipped).

Line LinePattern Delim

Single-line pattern of data with a delimiter.

Lines LinePattern (Maybe Integer) Delim

Multi-line data. Maybe Int determines the number of lines. If it is Nothing, then it is unknown so go to end of file. | Determines the pattern of data.

data LinePattern Source #

Constructors

Straight [DataItem]

Line of data with no pattern.

Repeat [DataItem]

Line of data with repeated pattern.

singleton :: DataItem -> Data Source #

Constructor for a single datum.

junkLine :: Data Source #

Constructor for junk data.

singleLine :: LinePattern -> Delim -> Data Source #

Constructor for a single line of data.

multiLine :: LinePattern -> Delim -> Data Source #

Constructor for an unknown amount of lines of data.

multiLine' :: LinePattern -> Integer -> Delim -> Data Source #

Constructor for multi-line data with a specified number of lines.

straight :: [DataItem] -> LinePattern Source #

Constructor for data with no pattern.

repeated :: [DataItem] -> LinePattern Source #

Constructor for data with a repeated pattern.

isJunk :: Data -> Bool Source #

Checks if a piece of Data' is JunkData.

isLine :: Data -> Bool Source #

Checks if a piece of Data' is only a single line.

isLines :: Data -> Bool Source #

Checks if a piece of Data' is multi-line.

getInputs :: DataDesc -> [DataItem] Source #

Gets the data inputs from a DataDesc.

getDataInputs :: Data -> [DataItem] Source #

Helper that gets data inputs from Data'.

getPatternInputs :: LinePattern -> [DataItem] Source #

Helper that gets the data inputs from single-line or multi-line data.