on develop help sign in
hlint fixes
commitb7eaf8983f2a73072ce0300acf1723235641cd67 authorOwen Shepherd <owen.shepherd@obsidian.systems> dateMon 6 Apr 2020, 17:00 (7 years ago) parentd73838e
4 files changed+4−9
src/Data/List/NonEmpty/Deferred.hs−1 src/Data/TagMap.hs+1−1 src/Data/Unique/Tag/Local/Internal.hs+1−4 src/Reflex/Requester/Base/Internal.hs+2−3
src/Data/List/NonEmpty/Deferred.hs−1
@@ -2,7 +2,6 @@
22-- prevents external observers from observing the non-associativity. This
33-- allows O(1) '(<>)'.
44
5−{-# LANGUAGE LambdaCase #-}
65module Data.List.NonEmpty.Deferred
76 ( NonEmptyDeferred
87 , singleton
src/Data/TagMap.hs+1−1
@@ -28,7 +28,7 @@ fromDMap :: forall k x (v :: k -> *). DMap (Tag x) v -> TagMap x v
2828fromDMap = TagMap . IntMap.fromDistinctAscList . fmap (\((k :: Tag x (a :: k)) :=> v) -> (tagId k, (unsafeCoerce :: v a -> Any) v)) . DMap.toAscList
2929
3030toDMap :: forall x v. TagMap x v -> DMap (Tag x) v
31−toDMap = DMap.fromDistinctAscList . fmap (\(k, v) -> (unsafeTagFromId k :=> (unsafeCoerce :: Any -> v a) v)) . IntMap.toAscList . unTagMap
31+toDMap = DMap.fromDistinctAscList . fmap (\(k, v) -> unsafeTagFromId k :=> (unsafeCoerce :: Any -> v a) v) . IntMap.toAscList . unTagMap
3232
3333insert :: forall x a v. Tag x a -> v a -> TagMap x v -> TagMap x v
3434insert k v = TagMap . IntMap.insert (tagId k) ((unsafeCoerce :: v a -> Any) v) . unTagMap
src/Data/Unique/Tag/Local/Internal.hs+1−4
@@ -2,9 +2,6 @@
22-- 1. If the `s` parameters on two `TagGen`s can unify, then they contain the same MutVar
33-- 2. Two Tag values made from the same TagGen never contain the same Int
44
5−{-# LANGUAGE EmptyDataDecls #-}
6−{-# LANGUAGE DeriveFunctor #-}
7−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
85{-# LANGUAGE TypeFamilies #-}
96{-# LANGUAGE PolyKinds #-}
107{-# LANGUAGE RankNTypes #-}
@@ -31,7 +28,7 @@ tagId (Tag n) = n
3128-- incorrect unsafeCoerce applications, which can segfault or cause arbitrary
3229-- other damage to your program
3330unsafeTagFromId :: Int -> Tag x a
34−unsafeTagFromId n = Tag n
31+unsafeTagFromId = Tag
3532
3633-- We use Int because it is supported by e.g. IntMap
3734newtype TagGen ps s = TagGen { unTagGen :: MutVar ps Int }
src/Reflex/Requester/Base/Internal.hs+2−3
@@ -10,7 +10,6 @@
1010{-# LANGUAGE RecursiveDo #-}
1111{-# LANGUAGE ScopedTypeVariables #-}
1212{-# LANGUAGE StandaloneDeriving #-}
13−{-# LANGUAGE TypeApplications #-}
1413{-# LANGUAGE TypeFamilies #-}
1514{-# LANGUAGE TypeOperators #-}
1615{-# LANGUAGE UndecidableInstances #-}
@@ -297,7 +296,7 @@ matchResponsesWithRequests f send recv = withTagGen $ \tagGen -> mdo
297296
298297requestEnvelopesToDSums :: forall s request. NonEmptyDeferred (RequestEnvelope s request) -> [DSum (Tag s) request]
299298requestEnvelopesToDSums requestEnvelopes = catMaybes $ f <$> NonEmptyDeferred.toList requestEnvelopes
300− where f :: (RequestEnvelope s request) -> Maybe (DSum (Tag s) request)
299+ where f :: RequestEnvelope s request -> Maybe (DSum (Tag s) request)
301300 f (RequestEnvelope (Just tag) v) = Just (tag :=> v)
302301 f (RequestEnvelope Nothing _) = Nothing
303302
@@ -307,4 +306,4 @@ singletonRequestData tagGen maybeTag request =
307306
308307singletonResponseData :: TagGen ps s -> Tag ps s -> response a -> ResponseData ps response
309308singletonResponseData tagGen tag response =
310− ResponseData tagGen $ TagMap.singletonTagMap tag response
309+ ResponseData tagGen $ TagMap.singletonTagMap tag response