expandableAlt
This commit is contained in:
@@ -2,6 +2,7 @@ module Compiler.Types
|
||||
( SrcSpan(..)
|
||||
, srcspanLine, srcspanColumn, srcspanAbs, srcspanLen
|
||||
, Located(..)
|
||||
, locating
|
||||
, nolo
|
||||
, (<<~), (<~>)
|
||||
|
||||
@@ -57,6 +58,9 @@ srcspanLen = tupling . _4
|
||||
nolo :: a -> Located a
|
||||
nolo = Located (SrcSpan 0 0 0 0)
|
||||
|
||||
locating :: Lens (Located a) (Located b) a b
|
||||
locating = lens extract ($>)
|
||||
|
||||
instance Semigroup SrcSpan where
|
||||
SrcSpan la ca aa sa <> SrcSpan lb cb ab sb = SrcSpan l c a s where
|
||||
l = min la lb
|
||||
|
||||
Reference in New Issue
Block a user