Skip to content

Commit

Permalink
generalize getSnd type
Browse files Browse the repository at this point in the history
  • Loading branch information
deyaaeldeen committed Dec 3, 2018
1 parent b0b79ac commit 05009fe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Language/Grift/Source/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ module Language.Grift.Source.Utils
, stripSnd
) where

import Data.Monoid (Sum (..))

import Language.Grift.Source.Syntax


Expand All @@ -24,7 +22,7 @@ para f (Ann a e) = f a $ fmap keepCopy e where
bottomUp :: forall a b e. Functor e => (a -> e (Ann b e) -> b) -> Ann a e -> Ann b e
bottomUp fn = cata (\a e -> Ann (fn a e) e)

getSnd :: forall a e. Ann (a, Sum Int) e -> Sum Int
getSnd :: forall a b e. Ann (a, b) e -> b
getSnd (Ann (_, n) _) = n

getFst :: forall a b. Ann (a, b) Type -> a
Expand Down

0 comments on commit 05009fe

Please sign in to comment.