Rlp2Core: simple let binds

This commit is contained in:
crumbtoo
2024-02-09 14:46:50 -07:00
parent 5749c0efd3
commit 2492660da4
5 changed files with 56 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ module Compiler.Types
, srcspanLine, srcspanColumn, srcspanAbs, srcspanLen
, Located(..)
, _Located
, located
, nolo
, (<<~), (<~>), (<#>)
@@ -25,6 +26,9 @@ import Language.Haskell.TH.Syntax (Lift)
data Located a = Located SrcSpan a
deriving (Show, Lift, Functor)
located :: Lens (Located a) (Located b) a b
located = lens extract ($>)
instance Apply Located where
liftF2 f (Located sa p) (Located sb q)
= Located (sa <> sb) (p `f` q)