-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor - Lenses for Ann
in Oczor.Syntax.Types
#16
Conversation
src/Oczor/Compiler/Utl.hs
Outdated
|
||
inferTxt :: String -> Either Error TypeExpr | ||
inferTxt x = normalizeType <$> (Parser.parseExpr x >>= inferType) | ||
|
||
inferAstTxt2 :: String -> Either Error InferExpr | ||
inferAstTxt2 x = Parser.parseExpr x >>= (\y -> snd <$> inferAllExpr emptyContext y) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ты совсем что-то расслабился. Откатывай эти пробельчики, они не связаны. А я засквошу. Чтоб такого не было впредь, забудь о git commit -a
, юзай -p
src/Oczor/Infer/InferAst.hs
Outdated
@@ -3,15 +3,15 @@ module Oczor.Infer.InferAst where | |||
import ClassyPrelude | |||
import Data.Functor.Foldable hiding (Foldable) | |||
import Oczor.Syntax.Syntax | |||
import Oczor.Infer.Substitutable | |||
import Oczor.Infer.Substitutable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробельчики!
src/Oczor/Infer/InferAst.hs
Outdated
@@ -25,4 +25,4 @@ removeContext = cata $ \case | |||
instance Substitutable InferExpr where | |||
-- apply s | traceArgs ["apply inferExpr", show s] = undefined | |||
apply s = cata $ \case (AnnF ast (tp,ctx)) -> Ann (apply s ast) (apply s tp, apply s ctx) -- TODO FF (apply ast) | |||
-- ftv = cata $ \case (AnnF ast tp) -> ftv tp | |||
-- ftv = cata $ \case (AnnF ast tp) -> ftv tp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Аяяй!
src/Oczor/Syntax/Ast.hs
Outdated
@@ -10,6 +10,7 @@ module Oczor.Syntax.Ast (module Oczor.Syntax.Ast, module Oczor.Syntax.Types, Lit | |||
import ClassyPrelude | |||
import Data.Functor.Foldable | |||
import Data.Functor.Foldable.TH | |||
import Control.Lens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По алфавиту же старайся!
src/Oczor/Syntax/Ast.hs
Outdated
|
||
type instance Base (Ann f a) = AnnF f a | ||
|
||
instance Functor f => Recursive (Ann f a) where | ||
project = \case Ann f a -> AnnF f a | ||
project = \case Ann f a -> AnnF f a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробельчики!
src/Oczor/Syntax/Ast.hs
Outdated
|
||
instance Functor f => Corecursive (Ann f a) where | ||
embed = \case AnnF f a -> Ann f a | ||
embed = \case AnnF f a -> Ann f a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробельчики!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Где тут пробельчики?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в начале строки. git reset -p HEAD~1
подскажет где :) (подставь 2, 3 по надобности)
src/Oczor/Syntax/Ast.hs
Outdated
|
||
instance Show a => Show (Ann ExprF a) where | ||
show (Ann x y) = "(" ++ show x ++ " ANN " ++ show y ++ ")" | ||
show (Ann x y) = "(" <> show x <> " ANN " <> show y <> ")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не связано
src/Oczor/Syntax/Ast.hs
Outdated
|
||
pattern UnAnn x <- Ann x y | ||
|
||
pattern ExprListMD x <- MD y (ExprList x) | ||
pattern LabelAccessCall label e = Call (LabelAccess label) e | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробельчики!
No description provided.