[Haskell-cafe] Refactoring status

Felipe Lessa felipe.lessa at gmail.com
Fri Jan 4 15:13:26 EST 2008


On Jan 4, 2008 5:52 PM, Peter Verswyvelen <bf3 at telenet.be> wrote:
> > It's already possible to write
> > asTypeOf ::
> >     a   {- ^ the input value to be passed through -}
> >  -> a   {- ^ the value is ignored, but the type is unified with the first
> parameter -}
> >  -> a   {- ^ the value of the first parameter -}
>
> Nice. Still using "first parameter" though ;-)

-- | Pass through the input value but forces unification
--   of its type with the type of the other argument.
asTypeOf :: a -- ^ The input value to be passed through.
         -> a -- ^ The other value whose type will be unified.
         -> a -- ^ The input value.
asTypeOf = const

-- 
Felipe.


More information about the Haskell-Cafe mailing list