1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

toDeclaration is an R-algebra.

This commit is contained in:
Rob Rix 2017-10-04 12:42:01 -04:00
parent 67b4da98c9
commit 20564b5a11

View File

@ -93,7 +93,7 @@ data Declaration
class HasDeclaration f where
toDeclaration :: Blob -> f a -> Maybe Declaration
toDeclaration :: Blob -> RAlgebra f t (Maybe Declaration)
instance (DeclarationStrategy f ~ strategy, HasDeclarationWithStrategy strategy f) => HasDeclaration f where
toDeclaration = toDeclarationWithStrategy (undefined :: proxy strategy)
@ -102,7 +102,7 @@ instance (DeclarationStrategy f ~ strategy, HasDeclarationWithStrategy strategy
data Strategy = Default | Custom
class HasDeclarationWithStrategy (strategy :: Strategy) f where
toDeclarationWithStrategy :: proxy strategy -> Blob -> f a -> Maybe Declaration
toDeclarationWithStrategy :: proxy strategy -> Blob -> RAlgebra f t (Maybe Declaration)
type family DeclarationStrategy f where