Created
May 9, 2014 14:22
-
-
Save smurphy8/da90f1edf364983937c0 to your computer and use it in GitHub Desktop.
lens page example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings,TemplateHaskell, MultiParamTypeClasses | |
, FunctionalDependencies, FlexibleInstances, RecordWildCards #-} | |
module AlarmState.Lens where | |
import qualified Protocol.Mir3.Simple.Mir3SimpleTypes as M | |
import Alarm.DB.Types | |
import AlarmState.Types (AlarmRunner,AlarmParameters,People,Person,AlarmState | |
,AnyAlarm(..),AnyCall(..),AlarmCallout(..) ,InProgress(..) | |
,CallResponse(..),AnyCount(..),ValidCall(..)) | |
import Control.Lens | |
makeClassy_ ''AlarmStateConfig | |
makeClassy_ ''CallOrderUser | |
makeClassy_ ''AlarmRunner | |
makeClassy_ ''AlarmParameters | |
makeClassy_ ''People | |
makeClassy_ ''Person | |
makeClassy_ ''AlarmState | |
makeClassy_ ''ValidCall | |
makeClassy_ ''CallResponse | |
makePrisms ''M.Mir3Result | |
makePrisms ''AnyAlarm | |
makePrisms ''AnyCall | |
makePrisms ''AlarmCallout | |
makePrisms ''InProgress | |
makePrisms ''CallResponse | |
makePrisms ''AnyCount | |
-- ascToCOUlens = _alrmCallOrderUsrs | |
makeLenses_ t = makeLensesWith ?? t $ defaultRules & lensField .~ \x -> Just (x ++ "_") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment