Skip to content
Snippets Groups Projects
Commit e4740dd8 authored by Łukasz Hanuszczak's avatar Łukasz Hanuszczak Committed by Mateusz Kowalczyk
Browse files

Create simple utility module for type specialization.

parent dc25b709
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,7 @@ library
Haddock.Backends.Xhtml.DocMarkup
Haddock.Backends.Xhtml.Layout
Haddock.Backends.Xhtml.Names
Haddock.Backends.Xhtml.Specialize
Haddock.Backends.Xhtml.Themes
Haddock.Backends.Xhtml.Types
Haddock.Backends.Xhtml.Utils
......
{-# LANGUAGE FlexibleContexts #-}
module Haddock.Backends.Xhtml.Specialize (specialize) where
import Haddock.Syb
import GHC
import Data.Data
specialize :: (Eq name, Data (HsType name))
=> name -> HsType name -> HsType name -> HsType name
specialize name details = everywhere (mkT $ specialize' name details)
specialize' :: Eq name => name -> HsType name -> HsType name -> HsType name
specialize' name details (HsTyVar name') | name == name' = details
specialize' _ _ typ = typ
\ No newline at end of file
......@@ -97,6 +97,7 @@ executable haddock
Haddock.Backends.Xhtml.DocMarkup
Haddock.Backends.Xhtml.Layout
Haddock.Backends.Xhtml.Names
Haddock.Backends.Xhtml.Specialize
Haddock.Backends.Xhtml.Themes
Haddock.Backends.Xhtml.Types
Haddock.Backends.Xhtml.Utils
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment