mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Define a fixpoint over rank-n quantified mendler-style recursive functions.
This commit is contained in:
parent
89cdd3bda3
commit
835506030b
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE FlexibleContexts, LambdaCase, OverloadedStrings, RankNTypes, RecordWildCards #-}
|
||||
{-# LANGUAGE FlexibleContexts, LambdaCase, OverloadedStrings, RankNTypes, RecordWildCards, ScopedTypeVariables #-}
|
||||
module Analysis.Eval
|
||||
( eval
|
||||
, prog1
|
||||
@ -9,6 +9,7 @@ module Analysis.Eval
|
||||
, prog6
|
||||
, ruby
|
||||
, Analysis(..)
|
||||
, fix
|
||||
) where
|
||||
|
||||
import Control.Effect.Fail
|
||||
@ -26,6 +27,13 @@ import Data.Text (Text)
|
||||
import GHC.Stack
|
||||
import Prelude hiding (fail)
|
||||
|
||||
fix :: forall f a b
|
||||
. ((forall x . (x -> a) -> f x -> b) -> (forall x . (x -> a) -> f x -> b))
|
||||
-> (forall x . (x -> a) -> f x -> b)
|
||||
fix f = x
|
||||
where x :: (x -> a) -> f x -> b
|
||||
x = f x
|
||||
|
||||
eval :: ( Carrier sig m
|
||||
, Member (Reader Loc) sig
|
||||
, MonadFail m
|
||||
|
Loading…
Reference in New Issue
Block a user