8 May 21:32
Re: [Haskell] Help with polymorphic functions
From: Reinier Lamers <tux_rocker <at> reinier.de>
Subject: Re: [Haskell] Help with polymorphic functions
Newsgroups: gmane.comp.lang.haskell.cafe
Date: 2008-05-08 19:32:24 GMT
Subject: Re: [Haskell] Help with polymorphic functions
Newsgroups: gmane.comp.lang.haskell.cafe
Date: 2008-05-08 19:32:24 GMT
Op Thursday 08 May 2008 21:10:08 schreef Wei Yuan Cai: > shift is defined as "a -> Int -> a" It's not. It's defined as "(Bits a) => a -> Int -> a" or something along those lines. So there is a restriction that the type a must be a member of the Bits typeclass. Because "test" is essentially just "shift", its type must also be "(Bits a) => a -> Int -> a". Reinier
RSS Feed