Skip to content
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

Merged
merged 6 commits into from
Mar 28, 2017

Conversation

xgrommx
Copy link
Contributor

@xgrommx xgrommx commented Mar 28, 2017

No description provided.


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)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ты совсем что-то расслабился. Откатывай эти пробельчики, они не связаны. А я засквошу. Чтоб такого не было впредь, забудь о git commit -a, юзай -p

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пробельчики!

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аяяй!

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По алфавиту же старайся!


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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пробельчики!


instance Functor f => Corecursive (Ann f a) where
embed = \case AnnF f a -> Ann f a
embed = \case AnnF f a -> Ann f a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пробельчики!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Где тут пробельчики?)

Copy link
Collaborator

@nponeccop nponeccop Mar 28, 2017

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 по надобности)


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 <> ")"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не связано


pattern UnAnn x <- Ann x y

pattern ExprListMD x <- MD y (ExprList x)
pattern LabelAccessCall label e = Call (LabelAccess label) e

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пробельчики!

@nponeccop nponeccop merged commit 93ff9ca into ptol:master Mar 28, 2017
@xgrommx xgrommx deleted the refactoring-of-ann branch March 29, 2017 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants