duckling-0.1.6.1: A Haskell library for parsing text into structured data.

Safe HaskellNone
LanguageHaskell2010

Duckling.Duration.Types

Synopsis

Documentation

data DurationData Source #

Constructors

DurationData 

Fields

Instances

Eq DurationData Source # 
Ord DurationData Source # 
Show DurationData Source # 
Generic DurationData Source # 

Associated Types

type Rep DurationData :: * -> * #

Semigroup DurationData Source # 
ToJSON DurationData Source # 
NFData DurationData Source # 

Methods

rnf :: DurationData -> () #

Hashable DurationData Source # 
Resolve DurationData Source # 
type Rep DurationData Source # 
type Rep DurationData = D1 * (MetaData "DurationData" "Duckling.Duration.Types" "duckling-0.1.6.1-83m0Jl1y16C43giMGsHrS3" False) (C1 * (MetaCons "DurationData" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "value") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Int)) (S1 * (MetaSel (Just Symbol "grain") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Grain))))
type ResolvedValue DurationData Source # 

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.