1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

Define a HasDeclaration instance in terms of strategies.

This commit is contained in:
Rob Rix 2017-10-04 12:35:14 -04:00
parent 5ab89d2850
commit e30fe8f9bf

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DataKinds, MultiParamTypeClasses, RankNTypes, TypeFamilies, TypeOperators, ScopedTypeVariables #-} {-# LANGUAGE DataKinds, MultiParamTypeClasses, RankNTypes, TypeFamilies, TypeOperators, ScopedTypeVariables, UndecidableInstances #-}
module Renderer.TOC module Renderer.TOC
( renderToCDiff ( renderToCDiff
, renderToCTerm , renderToCTerm
@ -95,6 +95,8 @@ data Declaration
class HasDeclaration f where class HasDeclaration f where
toDeclaration :: f a -> Maybe Declaration toDeclaration :: f a -> Maybe Declaration
instance (DeclarationStrategy f ~ strategy, HasDeclarationWithStrategy strategy f) => HasDeclaration f where
toDeclaration = toDeclarationWithStrategy (undefined :: proxy strategy)
data Strategy = Default | Custom data Strategy = Default | Custom