aboutsummaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-02-11 22:10:23 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-02-11 22:10:23 +0000
commit23952a7a6446ef5eee9dce11d3651d4a31979eec (patch)
tree43693e013ff4875412768561e71aec26ac8bb8c6 /server/src
parent501441e2e5c96c85dec68dc42992d91db055f092 (diff)
downloadthermoprint-23952a7a6446ef5eee9dce11d3651d4a31979eec.tar
thermoprint-23952a7a6446ef5eee9dce11d3651d4a31979eec.tar.gz
thermoprint-23952a7a6446ef5eee9dce11d3651d4a31979eec.tar.bz2
thermoprint-23952a7a6446ef5eee9dce11d3651d4a31979eec.tar.xz
thermoprint-23952a7a6446ef5eee9dce11d3651d4a31979eec.zip
nicer Seq -> Set morphism
Diffstat (limited to 'server/src')
-rw-r--r--server/src/Thermoprint/Server/Queue.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/src/Thermoprint/Server/Queue.hs b/server/src/Thermoprint/Server/Queue.hs
index b752576..dcd4119 100644
--- a/server/src/Thermoprint/Server/Queue.hs
+++ b/server/src/Thermoprint/Server/Queue.hs
@@ -109,10 +109,10 @@ instance Ord PlainQueueItem where
109 (unPlain -> Current _ ) <= _ = True 109 (unPlain -> Current _ ) <= _ = True
110 110
111fromZipper :: Queue -> Set QueueItem 111fromZipper :: Queue -> Set QueueItem
112fromZipper Queue{..} = Set.fromList . toList $ mconcat [ Seq.mapWithIndex Pending pending 112fromZipper Queue{..} = foldr Set.insert Set.empty $ mconcat [ Seq.mapWithIndex Pending pending
113 , maybe Seq.empty (Seq.singleton . Current) current 113 , maybe Seq.empty (Seq.singleton . Current) current
114 , Seq.mapWithIndex (\i (a, e) -> History i a e) history 114 , Seq.mapWithIndex (\i (a, e) -> History i a e) history
115 ] 115 ]
116 116
117toZipper :: Set QueueItem -> Queue 117toZipper :: Set QueueItem -> Queue
118toZipper = Set.foldl' (flip insert) def 118toZipper = Set.foldl' (flip insert) def