Hello Ian,
Wednesday, February 08, 2006, 9:28:51 PM, you wrote:
>> nonrecursive let in Haskell so that I could write let x = ...x... in ...,
IL> I would argue that the language should discourage variable shadowing, so
IL> that shadow warnings can be used to find bugs.
i use such shadowing to chan
On Wed, Feb 08, 2006 at 06:01:15PM +, Ben Rudiak-Gould wrote:
>
> Well, I took it as a stripped-down example. I've often wished for a
> nonrecursive let in Haskell so that I could write let x = ...x... in ...,
> and restricting x's interface would be similarly useful. But you could
> argue
Marcin 'Qrczak' Kowalczyk wrote:
Ben Rudiak-Gould <[EMAIL PROTECTED]> writes:
Parametricity, what else?
But he is writing the function inline.
Well, I took it as a stripped-down example. I've often wished for a
nonrecursive let in Haskell so that I could write let x = ...x... in ...,
and re
Ben Rudiak-Gould <[EMAIL PROTECTED]> writes:
>>> that i want to say is what the first variant allows to define type of
>>> 'x' in such way that the only Show-specific operations are allowed,
>> Why?
>
> Parametricity, what else? I'd much rather pass my precious String to a
> function of type [a] -
Bulat Ziganshin wrote:
main = do return "xx" >>= ((\x -> print x) :: Show a => a -> IO ())
main2 = do return "xx" >>= (\(x:: (forall a . (Show a) => a)) -> print x)
main3 = do (x :: forall a . Show a => a) <- return "xx"
print x
the second and third variant should do the same, to my
Marcin 'Qrczak' Kowalczyk wrote:
Bulat Ziganshin <[EMAIL PROTECTED]> writes:
that i want to say is what the first variant allows to define type of
'x' in such way that the only Show-specific operations are allowed,
Why?
Parametricity, what else? I'd much rather pass my precious String to a
Bulat Ziganshin <[EMAIL PROTECTED]> writes:
> that i want to say is what the first variant allows to define type of
> 'x' in such way that the only Show-specific operations are allowed,
Why? A class is not a type. Haskell has no non-trivial subtyping.
If it's always a string, then it can be treat
Hello Ben,
Tuesday, February 07, 2006, 11:21:56 PM, you wrote:
>> {-# OPTIONS_GHC -fglasgow-exts #-}
>> main = do return "xx" >>= ((\x -> print x) :: Show a => a -> IO ())
>> main2 = do return "xx" >>= (\(x:: (forall a . (Show a) => a)) -> print x)
>> main3 = do (x :: forall a . Show a => a) <- r
Bulat Ziganshin wrote:
{-# OPTIONS_GHC -fglasgow-exts #-}
main = do return "xx" >>= ((\x -> print x) :: Show a => a -> IO ())
main2 = do return "xx" >>= (\(x:: (forall a . (Show a) => a)) -> print x)
main3 = do (x :: forall a . Show a => a) <- return "xx"
print x
in this module, only
Hello haskell-prime,
about limiting variable usage inside a function to some interface - it
is possible, although is not pleasant :)
{-# OPTIONS_GHC -fglasgow-exts #-}
main = do return "xx" >>= ((\x -> print x) :: Show a => a -> IO ())
main2 = do return "xx" >>= (\(x:: (forall a . (Show a) => a)
10 matches
Mail list logo