Skip to content

Instantly share code, notes, and snippets.

@FruitieX
Created March 6, 2018 17:10
Show Gist options
  • Select an option

  • Save FruitieX/afcc74e99a22db6b6c540fd1ef7edfd1 to your computer and use it in GitHub Desktop.

Select an option

Save FruitieX/afcc74e99a22db6b6c540fd1ef7edfd1 to your computer and use it in GitHub Desktop.
-- WTF instant creates a Maybe Instant
toLight :: StupidIntermediateStrMapThingy -> Maybe Lights
toLight =
foldlWithIndex (\k m v -> do
let transitionStart = instant (Milliseconds v.transitionStart)
let transitionTime = Milliseconds v.transitionTime
insert (LightId k) (Light v { transitionStart = transitionStart, transitionTime = transitionTime }) m
) empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment