on master help sign in
Rename A.drop to A.toValue
commit76d3d24cbafdde973616f0739ed4892ec5f2ba8c authorEvan Czaplicki <evancz@users.noreply.github.com> dateThu 30 Nov 2017, 15:08 (9 years ago) parent5c0addd
2 files changed+12−5
src/Parse/Repl.hs+1−1 src/Reporting/Annotation.hs+11−4
src/Parse/Repl.hs+1−1
@@ -74,7 +74,7 @@ entryParser source =
7474
7575 , do root <- Pattern.term
7676 spaces
77− case A.drop root of
77+ case A.toValue root of
7878 Src.PVar name ->
7979 oneOf
8080 [ do Symbol.hasType
src/Reporting/Annotation.hs+11−4
@@ -2,13 +2,15 @@
22module Reporting.Annotation
33 ( Located(..)
44 , at, merge
5− , map, drop
5+ , map
6+ , toValue
7+ , toRegion
68 , traverse
79 )
810 where
911
1012
11−import Prelude hiding (drop, map, traverse)
13+import Prelude hiding (map, traverse)
1214import qualified Reporting.Region as R
1315
1416
@@ -43,11 +45,16 @@ map f (At info value) =
4345 At info (f value)
4446
4547
46−drop :: Located a -> a
47−drop (At _ value) =
48+toValue :: Located a -> a
49+toValue (At _ value) =
4850 value
4951
5052
53+toRegion :: Located a -> R.Region
54+toRegion (At region _) =
55+ region
56+
57+
5158traverse :: (Functor f) => (a -> f b) -> Located a -> f (Located b)
5259traverse func (At region value) =
5360 At region <$> func value