duckling-0.2.0.0: A Haskell library for parsing text into structured data.
Safe HaskellNone
LanguageHaskell2010

Duckling.Duration.Types

Synopsis

Documentation

data DurationData Source #

Constructors

DurationData 

Fields

Instances

Instances details
Eq DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

Ord DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

Show DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

Generic DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

Associated Types

type Rep DurationData :: Type -> Type #

Semigroup DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

Hashable DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

ToJSON DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

NFData DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

Methods

rnf :: DurationData -> () #

Resolve DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

Associated Types

type ResolvedValue DurationData Source #

type Rep DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

type Rep DurationData = D1 ('MetaData "DurationData" "Duckling.Duration.Types" "duckling-0.2.0.0-4AU1pRwMU7E8YjNdB7ILfy" 'False) (C1 ('MetaCons "DurationData" 'PrefixI 'True) (S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "grain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Grain)))
type ResolvedValue DurationData Source # 
Instance details

Defined in Duckling.Duration.Types

withGrain :: Grain -> DurationData -> DurationData Source #

Convert a duration to the given grain, rounded to the nearest integer. For example, 1 month is converted to 4 weeks.