Hello all,
I'm having difficulties understanding rank-2 polymorphism in combination
with overloading. Consider the following contrived definition:
f :: (forall a . Eq a = a - a - Bool) - Bool
f eq = eq True True
Then, we pass f both an overloaded function and a regular polymorphic
function:
On 26-4-2010 20:13, Jochem Berndsen wrote:
Thomas van Noort wrote:
...
f requires a function that is able to compute, for two values of type a
(which instantiates Eq), a Boolean.
y certainly fulfills that requirement: it does not even require that the
values are of a type instantiating Eq
On 26-4-2010 20:12, Daniel Fischer wrote:
Am Montag 26 April 2010 19:52:23 schrieb Thomas van Noort:
...
Yes, y's type is more general than the type required by f, hence y is an
acceptable argument for f - even z :: forall a b. a - b - Bool is.
That's what I thought. I've just never seen
PROTECTED]
[1] Thomas van Noort. Generic views for generic types. Master's thesis,
Utrecht University, 2008.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
structure type.
Regards,
Thomas
On 12/04/2008, Thomas van Noort [EMAIL PROTECTED] wrote:
Generic Haskell includes the following features:
* type-indexed values -- generic functions that can be
instantiated on all Haskell data types.
^^^
I have perused
On 12/04/2008, Thomas van Noort [EMAIL PROTECTED] wrote:
That's a good question. Unfortunately, only Haskell98 types are
currently
supported by the Generic Haskell compiler.
I thought constrained types were Haskell 98, but now I'm in doubt...
I'm not 100% sure either, but according
Pablo Nogueira wrote:
This has certainly been taken into account when comparing approaches to
generic programming. I quote from page 18/19 from the work you and Bulat
Indeed I was not aware of it. Missed that. Thanks for pointing it out!
Thus, full reflexivity of an approach is taken into
Hello,
I took the liberty to move this discussion to the Haskell-Cafe mailing list.
Adrian Hey wrote:
Thomas van Noort wrote:
Pleasant programming,
Hello,
This looks like good stuff. But having done all this work it seems
a pity not to go the extra mm and cabalise this and make
You can hide () from the implicit import of Prelude using:
import Prelude hiding (())
Kind regards,
Thomas
michael rice wrote:
I've been working through this example from:
http://en.wikibooks.org/wiki/Haskell/Understanding_monads
I understand what they're doing all the way up to the
This is a recurring problem[1] and I'm still looking for a really
satisfying solution. The only working and non-verbose solution I found
is the one Miguel suggests. Although I'm not too fond of splitting up
the monadic functions into separate type classes. A similar solution is
described
Hello,
I have a question regarding type family signatures. Consider the
following type family:
type family Fam a :: *
Then I define a GADT that takes such a value and wraps it:
data GADT :: * - * where
GADT :: a - Fam a - GADT (Fam a)
and an accompanying unwrapper:
unwrap ::
Somehow I didn't receive David's mail, but his explanation makes a lot
of sense. I'm still wondering how this results in a type error involving
rigid type variables.
Ryan Ingram wrote:
On Fri, Aug 14, 2009 at 12:03 PM, Dan Westonweston...@imageworks.com wrote:
But presumably he can use a
Thank your for this elaborate explanation, you made my day!
Thomas
Ryan Ingram wrote:
On Mon, Aug 17, 2009 at 12:12 AM, Thomas van Noorttho...@cs.ru.nl wrote:
Somehow I didn't receive David's mail, but his explanation makes a lot of
sense. I'm still wondering how this results in a type error
Hi,
I would like to verify a list of properties using QuickCheck. Of course,
I can test a single property using:
quickCheck :: Testable prop = prop - IO ()
Then, I can check a list of properties my mapping this function over a list:
quickCheckL :: Testable prop = [prop] - IO ()
quickCheckL
datatypes or
with nested datatypes.
This library has been described in the paper:
A Lightweight Approach to Datatype-Generic Rewriting. Thomas van
Noort, Alexey Rodriguez, Stefan Holdermans, Johan Jeuring, Bastiaan
Heeren. ACM SIGPLAN Workshop on Generic Programming 2008.
More information
Hello,
Recently, we released a library on Hackage for generic rewriting
(package rewriting if you are curious). The user of the library is
expected to define type class instances to enable rewriting on his or
her own datatypes. As these instances follow the datatype declarations
closely, we
://hackage.haskell.org/trac/ghc/ticket/1673). Maybe it would be
good if the remaining syntax (associated datatypes and type families)
would also be defined and implemented in TH. Or maybe there isn't much
demand for this?...
Cheers,
Pedro
On Wed, Nov 5, 2008 at 15:57, Thomas van Noort [EMAIL
Hi Greg,
We didn't look into nominal rewriting I'm afraid. And I'm not that
familiar with scrap-your-nameplate so I'm not sure if you can implement
nominal rewriting using that library.
Regards,
Thomas
Greg Meredith wrote:
Thomas,
Did you explore nominal rewrite at all? Do you know if it
First thing I noticed, how about removing the sqrt in isInCircle:
isInCircle :: (Floating a, Ord a) = (a,a) - Bool
isInCircle (x,y) = x*x + y*y = 1.0
But you can remove sqrt from the C++ implementation as well, so it only
improves the relative performance if the C++ implementation of sqrt is
But you can remove sqrt from the C++ implementation as well, so it only
improves the relative performance if the C++ implementation of sqrt is
worse than its Haskell counterpart.
Oops, of course I mean, you only improve if Haskell's implementation is
worse than C++'s implementation :)
20 matches
Mail list logo