on master help sign in
Rename A.drop to A.toValue
76d3d24Evan Czaplicki
src/Parse/Repl.hs+1−1
@@ -74,7 +74,7 @@ entryParser source =
74
74
75 , do root <- Pattern.term
75 , do root <- Pattern.term
76 spaces
76 spaces
77− case A.drop root of
77+ case A.toValue root of
78 Src.PVar name ->
78 Src.PVar name ->
79 oneOf
79 oneOf
80 [ do Symbol.hasType
80 [ do Symbol.hasType
src/Reporting/Annotation.hs+11−4
@@ -2,13 +2,15 @@
2module Reporting.Annotation
2module Reporting.Annotation
3 ( Located(..)
3 ( Located(..)
4 , at, merge
4 , at, merge
5− , map, drop
5+ , map
6+ , toValue
7+ , toRegion
6 , traverse
8 , traverse
7 )
9 )
8 where
10 where
9
11
10
12
11−import Prelude hiding (drop, map, traverse)
13+import Prelude hiding (map, traverse)
12import qualified Reporting.Region as R
14import qualified Reporting.Region as R
13
15
14
16
@@ -43,11 +45,16 @@ map f (At info value) =
43 At info (f value)
45 At info (f value)
44
46
45
47
46−drop :: Located a -> a
48+toValue :: Located a -> a
47−drop (At _ value) =
49+toValue (At _ value) =
48 value
50 value
49
51
50
52
53+toRegion :: Located a -> R.Region
54+toRegion (At region _) =
55+ region
56+
57+
51traverse :: (Functor f) => (a -> f b) -> Located a -> f (Located b)
58traverse :: (Functor f) => (a -> f b) -> Located a -> f (Located b)
52traverse func (At region value) =
59traverse func (At region value) =
53 At region <$> func value
60 At region <$> func value