Peter Hercek wrote:
But Haskell with Control.Exception extension has more values
of all types since they can be thrown and later caught and
investigated at that place.
Maybe the last sentence of section 2.1 (_|_ Bottom) of
Haskell/Denotational semantics should be clarified better.
Henning Thielemann wrote:
On Sat, 22 Nov 2008, Janis Voigtlaender wrote:
Definitely. And that surfaces even in quite innocently looking programs
and statements about them. The introductory example of the following
technical report may be amusing in that respect:
(...) One way to code this would be to use functional dependencies:
class MyClass r s | r - s where function :: r - s
One additional problem is that I (believe I) need that my class takes
just one type
FDs with just one type parameter are called ATs :)
(FDs = functional
ATs are Associated Types, aka Type Families. They can be found in
the GHC 6.10 manual here:
http://haskell.org/ghc/docs/6.10.1/html/users_guide/type-families.html
As a starting point, you might want to try something like:
class Complex c where
type RealType c
realPart :: c - RealType c
David Menendez wrote:
On Sun, Nov 16, 2008 at 7:09 PM, Luke Palmer [EMAIL PROTECTED] wrote:
On Sun, Nov 16, 2008 at 5:06 PM, Peter Hercek [EMAIL PROTECTED] wrote:
... and the only value the function can return is bottom.
Is there any type system which would have more than
one value which
On Tue, Nov 18, 2008 at 1:38 AM, Reiner Pope [EMAIL PROTECTED] wrote:
ATs are Associated Types, aka Type Families. They can be found in
the GHC 6.10 manual here:
http://haskell.org/ghc/docs/6.10.1/html/users_guide/type-families.html
As a starting point, you might want to try something like:
On Tue, 2008-11-18 at 19:05 +0100, Peter Hercek wrote:
David Menendez wrote:
On Sun, Nov 16, 2008 at 7:09 PM, Luke Palmer [EMAIL PROTECTED] wrote:
On Sun, Nov 16, 2008 at 5:06 PM, Peter Hercek [EMAIL PROTECTED] wrote:
... and the only value the function can return is bottom.
Is there any
Why is this wrong? (...)
(...) One way to code this would be to use functional dependencies:
class MyClass r s | r - s where function :: r - s
data MyData u = MyData u
instance MyClass (MyData v) v where function (MyData a) = a
One additional problem is that I (believe I) need that my
Hello Maurício,
Monday, November 17, 2008, 9:38:06 PM, you wrote:
(...) One way to code this would be to use functional dependencies:
class MyClass r s | r - s where function :: r - s
One additional problem is that I (believe I) need that my class takes
just one type
FDs with just
On Mon, Nov 17, 2008 at 10:38 AM, Maurício [EMAIL PROTECTED] wrote:
newtype ComplexWithDouble = ComplexWithDouble (ComplexNumber Double)
deriving ...
Perhaps you want something like:
class Complex r c | c - r
where makeComplex :: r - r - c
realPart :: c - r
imagPart
Perhaps you want something like:
class Complex r c | c - r
where makeComplex :: r - r - c
realPart :: c - r
imagPart :: c - r
data ComplexNumber t = CN t t
instance Complex t (ComplexNumber t)
where makeComplex = CN
realPart (CN r _) = r
imagPart
Bulat Ziganshin wrote:
Hello J.,
Monday, November 17, 2008, 12:56:02 AM, you wrote:
class MyClass r where function :: r - s
As Bulat said, your type signature is equivalent to:
function :: forall r s. r - s
only
function :: forall s. r - s
(r is fixed in class header)
... and the
On Sun, Nov 16, 2008 at 5:06 PM, Peter Hercek [EMAIL PROTECTED] wrote:
... and the only value the function can return is bottom.
Is there any type system which would have more than
one value which inhabits all types?
Well something like lazy C# might; i.e. every value has a _|_
On Sun, Nov 16, 2008 at 7:09 PM, Luke Palmer [EMAIL PROTECTED] wrote:
On Sun, Nov 16, 2008 at 5:06 PM, Peter Hercek [EMAIL PROTECTED] wrote:
... and the only value the function can return is bottom.
Is there any type system which would have more than
one value which inhabits all types?
Well
14 matches
Mail list logo