on develop help sign in
hlint fixes
b7eaf89Owen Shepherd
src/Data/List/NonEmpty/Deferred.hs−1
@@ -2,7 +2,6 @@
2-- prevents external observers from observing the non-associativity. This
2-- prevents external observers from observing the non-associativity. This
3-- allows O(1) '(<>)'.
3-- allows O(1) '(<>)'.
4
4
5−{-# LANGUAGE LambdaCase #-}
6module Data.List.NonEmpty.Deferred
5module Data.List.NonEmpty.Deferred
7 ( NonEmptyDeferred
6 ( NonEmptyDeferred
8 , singleton
7 , singleton
src/Data/TagMap.hs+1−1
@@ -28,7 +28,7 @@ fromDMap :: forall k x (v :: k -> *). DMap (Tag x) v -> TagMap x v
28fromDMap = TagMap . IntMap.fromDistinctAscList . fmap (\((k :: Tag x (a :: k)) :=> v) -> (tagId k, (unsafeCoerce :: v a -> Any) v)) . DMap.toAscList
28fromDMap = TagMap . IntMap.fromDistinctAscList . fmap (\((k :: Tag x (a :: k)) :=> v) -> (tagId k, (unsafeCoerce :: v a -> Any) v)) . DMap.toAscList
29
29
30toDMap :: forall x v. TagMap x v -> DMap (Tag x) v
30toDMap :: 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
32
32
33insert :: forall x a v. Tag x a -> v a -> TagMap x v -> TagMap x v
33insert :: forall x a v. Tag x a -> v a -> TagMap x v -> TagMap x v
34insert k v = TagMap . IntMap.insert (tagId k) ((unsafeCoerce :: v a -> Any) v) . unTagMap
34insert 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 @@
2-- 1. If the `s` parameters on two `TagGen`s can unify, then they contain the same MutVar
2-- 1. If the `s` parameters on two `TagGen`s can unify, then they contain the same MutVar
3-- 2. Two Tag values made from the same TagGen never contain the same Int
3-- 2. Two Tag values made from the same TagGen never contain the same Int
4
4
5−{-# LANGUAGE EmptyDataDecls #-}
6−{-# LANGUAGE DeriveFunctor #-}
7−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
8{-# LANGUAGE TypeFamilies #-}
5{-# LANGUAGE TypeFamilies #-}
9{-# LANGUAGE PolyKinds #-}
6{-# LANGUAGE PolyKinds #-}
10{-# LANGUAGE RankNTypes #-}
7{-# LANGUAGE RankNTypes #-}
@@ -31,7 +28,7 @@ tagId (Tag n) = n
31-- incorrect unsafeCoerce applications, which can segfault or cause arbitrary
28-- incorrect unsafeCoerce applications, which can segfault or cause arbitrary
32-- other damage to your program
29-- other damage to your program
33unsafeTagFromId :: Int -> Tag x a
30unsafeTagFromId :: Int -> Tag x a
34−unsafeTagFromId n = Tag n
31+unsafeTagFromId = Tag
35
32
36-- We use Int because it is supported by e.g. IntMap
33-- We use Int because it is supported by e.g. IntMap
37newtype TagGen ps s = TagGen { unTagGen :: MutVar ps Int }
34newtype TagGen ps s = TagGen { unTagGen :: MutVar ps Int }
src/Reflex/Requester/Base/Internal.hs+2−3
@@ -10,7 +10,6 @@
10{-# LANGUAGE RecursiveDo #-}
10{-# LANGUAGE RecursiveDo #-}
11{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE ScopedTypeVariables #-}
12{-# LANGUAGE StandaloneDeriving #-}
12{-# LANGUAGE StandaloneDeriving #-}
13−{-# LANGUAGE TypeApplications #-}
14{-# LANGUAGE TypeFamilies #-}
13{-# LANGUAGE TypeFamilies #-}
15{-# LANGUAGE TypeOperators #-}
14{-# LANGUAGE TypeOperators #-}
16{-# LANGUAGE UndecidableInstances #-}
15{-# LANGUAGE UndecidableInstances #-}
@@ -297,7 +296,7 @@ matchResponsesWithRequests f send recv = withTagGen $ \tagGen -> mdo
297
296
298requestEnvelopesToDSums :: forall s request. NonEmptyDeferred (RequestEnvelope s request) -> [DSum (Tag s) request]
297requestEnvelopesToDSums :: forall s request. NonEmptyDeferred (RequestEnvelope s request) -> [DSum (Tag s) request]
299requestEnvelopesToDSums requestEnvelopes = catMaybes $ f <$> NonEmptyDeferred.toList requestEnvelopes
298requestEnvelopesToDSums 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)
301 f (RequestEnvelope (Just tag) v) = Just (tag :=> v)
300 f (RequestEnvelope (Just tag) v) = Just (tag :=> v)
302 f (RequestEnvelope Nothing _) = Nothing
301 f (RequestEnvelope Nothing _) = Nothing
303
302
@@ -307,4 +306,4 @@ singletonRequestData tagGen maybeTag request =
307
306
308singletonResponseData :: TagGen ps s -> Tag ps s -> response a -> ResponseData ps response
307singletonResponseData :: TagGen ps s -> Tag ps s -> response a -> ResponseData ps response
309singletonResponseData tagGen tag response =
308singletonResponseData tagGen tag response =
310− ResponseData tagGen $ TagMap.singletonTagMap tag response
309+ ResponseData tagGen $ TagMap.singletonTagMap tag response