mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
Define a HasDeclaration instance in terms of strategies.
This commit is contained in:
parent
5ab89d2850
commit
e30fe8f9bf
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE DataKinds, MultiParamTypeClasses, RankNTypes, TypeFamilies, TypeOperators, ScopedTypeVariables #-}
|
||||
{-# LANGUAGE DataKinds, MultiParamTypeClasses, RankNTypes, TypeFamilies, TypeOperators, ScopedTypeVariables, UndecidableInstances #-}
|
||||
module Renderer.TOC
|
||||
( renderToCDiff
|
||||
, renderToCTerm
|
||||
@ -95,6 +95,8 @@ data Declaration
|
||||
class HasDeclaration f where
|
||||
toDeclaration :: f a -> Maybe Declaration
|
||||
|
||||
instance (DeclarationStrategy f ~ strategy, HasDeclarationWithStrategy strategy f) => HasDeclaration f where
|
||||
toDeclaration = toDeclarationWithStrategy (undefined :: proxy strategy)
|
||||
|
||||
|
||||
data Strategy = Default | Custom
|
||||
|
Loading…
Reference in New Issue
Block a user