foscam-filename-0.0.1: Foscam File format

Safe HaskellNone
LanguageHaskell2010

Data.Foscam.File.ImageId

Synopsis

Documentation

class AsImageId p f s where Source

Minimal complete definition

Nothing

Methods

_ImageId :: Optic' p f s ImageId Source

Instances

(Choice p, Applicative f) => AsImageId p f String Source 
AsImageId p f ImageId Source 
((~) (* -> * -> *) p (->), Functor f) => AsImageId p f Filename Source 

imageId :: (Monad f, CharParsing f) => f ImageId Source

>>> parse imageId "test" "2062"
Right (ImageId 2 [0,6,2])
>>> parse imageId "test" "2"
Right (ImageId 2 [])
>>> parse imageId "test" "a"
Left "test" (line 1, column 2):
expecting image ID
not a digit: a
>>> parse imageId "test" ""
Left "test" (line 1, column 1):
unexpected end of input
expecting image ID