[Haskell] PhD position in dependent types/functional programming at Chalmers

2015-02-27 Thread Andreas Abel
We have an opening for a PhD student in dependent type theory and functional programming at Chalmers. Here is an excerpt from the ad: The PhD student will join the Programming Logic group and contribute to its research on dependent type theory and functional programming. Topics of interest

[Haskell] PhD Position in dependent types, testing hardware design

2014-04-14 Thread Wouter Swierstra
== VACANCY : 1x Phd position in dependent types, testing hardware design == The research group of Software Technology is part of the Software Systems division

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-07-14 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types --+- Reporter: Lemming | Owner: Type

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-06-20 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types +--- Reporter: Lemming | Owner

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-06-18 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types +--- Reporter: Lemming | Owner

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-06-17 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types +--- Reporter: Lemming | Owner

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-04-26 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types +--- Reporter: Lemming | Owner

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-04-26 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types +--- Reporter: Lemming | Owner

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-04-26 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types +--- Reporter: Lemming | Owner

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-03-29 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types +--- Reporter: Lemming | Owner

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-03-29 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types +--- Reporter: Lemming | Owner

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-03-29 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types +--- Reporter: Lemming | Owner

Re: [GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-03-29 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types +--- Reporter: Lemming | Owner

[GHC] #5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types

2012-03-28 Thread GHC
#5978: Type error in one function causes wrong type error report in another function in the presence of functionally dependent types ---+ Reporter: Lemming| Owner

[Haskell-cafe] Type class for sequences with dependent types

2012-01-05 Thread Robbert Krebbers
Hello, in a Haskell development I have to represent paths that have elements of alternating types. GADTs allow me to do this easily: data AltList :: * - * - * where Nil :: AltList a a ICons :: Int - AltList Int b - AltList () b UCons :: () - AltList () b - AltList Int b Since I have

Re: [Haskell-cafe] Type class for sequences with dependent types

2012-01-05 Thread Markus Läll
Hi This has been discussed here[1] and here[2], and the answer is that its not possible because of making type inference generally impossible. It would be a useful feature though, and could be implemented by requiring the user give additional type signatures to help the inference algorithm out.

Re: [Haskell-cafe] Type class for sequences with dependent types

2012-01-05 Thread Eugene Kirpichov
Will this help? data List a b where List :: [a] - List a a 05.01.2012, в 17:12, Robbert Krebbers mailingli...@robbertkrebbers.nl написал(а): Hello, in a Haskell development I have to represent paths that have elements of alternating types. GADTs allow me to do this easily: data

Re: [Haskell-cafe] Type class for sequences with dependent types

2012-01-05 Thread Robbert Krebbers
Hi Eugene, with respect to typing your solution is a lot nicer since the type arguments are not just ignored. But apart from that it does not help too much in the below example, since it does not allow me to get rid of the additional constructor (List in your case, IntList in mine) and it

[Haskell-cafe] Constructor discipline and dependent types.

2011-07-17 Thread Patrick Browne
be no new variables on the RHS. So CD permits function to be defined and prohibits general assertions which are more in the domain of a specification language. Question 1: Is the above a reasonable understanding of CD? Question 2: I have read that the lack of dependent types (DT) prevents writing

Re: [Haskell-cafe] Constructor discipline and dependent types.

2011-07-17 Thread Stephen Tetley
On 17 July 2011 10:03, Patrick Browne patrick.bro...@dit.ie wrote: Question 1: Is the above a reasonable understanding of CD? From a brief look, constructor discipline (CD) restricts left-hand sides of equations to have no function calls themselves.

[Haskell-cafe] urWeb, Haskell and dependent types ....

2011-07-16 Thread Vasili I. Galchin
Hello, Here is probably a good paper to get people up to speed on dependent types (ironically written by two contributors to this mailing list??): okmij.org/ftp/papers/lightweight-static-capabilities.pdf Vasili ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] linear and dependent types

2011-02-19 Thread Dan Doel
On Saturday 19 February 2011 1:11:23 AM Vasili I. Galchin wrote: BTW I was thinking of http://www.ats.org when I asked this question. Technically speaking, if one considers ATS to be dependently typed, then one might as well also consider GHC to be dependently typed (with the right extensions

[Haskell-cafe] linear and dependent types

2011-02-18 Thread Vasili I. Galchin
Hello, Does Haskell currently have support for linear types and dependent types? If so, is it necessary to specify a pragma to use and if so, what is the pragma(s)? Kind regards, Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] linear and dependent types

2011-02-18 Thread Don Stewart
vigalchin: Hello, �� Does Haskell currently have support for linear types and dependent types? No. -- Don P.S. :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] linear and dependent types

2011-02-18 Thread Bas van Dijk
On 18 February 2011 20:04, Vasili I. Galchin vigalc...@gmail.com wrote:    Does Haskell currently have support for linear types and dependent types? If so, is it necessary to specify a pragma to use and if so, what is the pragma(s)? While Haskell doesn't have full dependent types, as found

Re: [Haskell-cafe] linear and dependent types

2011-02-18 Thread Vasili I. Galchin
for linear types and dependent types? If so, is it necessary to specify a pragma to use and if so, what is the pragma(s)? While Haskell doesn't have full dependent types, as found in say Agda, it (or rather GHC) does have some extensions that allow you to get many of the advantages of full

Re: [Haskell-cafe] linear and dependent types

2011-02-18 Thread oleg
There has been extensive discussion of whether Haskell has dependent types, made larger by the fact that the definition of dependently-typed languages is a bit fuzzy. On some accounts, type functions or GADTs are sufficient for calling a language dependently-typed, and Haskell got both features

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-07 Thread Petr Pudlak
, I was studying how cartesian closed categories can be used to describe typed functional languages. Types are objects and morphisms are functions from one type to another. Since I'm also interested in systems with dependent types, I wonder if there is a categorical description of such systems

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-03 Thread wren ng thornton
the (sum-product) version, but it is all largely a matter of taste. The product=function,sum=pair terminology comes from a certain interpretation of dependent types in set theory. I believe this originated with Per Martin-Löf's work, though I don't have any citations on hand. That terminology

[Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Petr Pudlak
Hi, recently, I was studying how cartesian closed categories can be used to describe typed functional languages. Types are objects and morphisms are functions from one type to another. Since I'm also interested in systems with dependent types, I wonder if there is a categorical description

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Larry Evans
On 12/02/10 09:13, Petr Pudlak wrote: Hi, recently, I was studying how cartesian closed categories can be used to describe typed functional languages. Types are objects and morphisms are functions from one type to another. Since I'm also interested in systems with dependent types, I

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread roconnor
On Thu, 2 Dec 2010, Petr Pudlak wrote: Hi, recently, I was studying how cartesian closed categories can be used to describe typed functional languages. Types are objects and morphisms are functions from one type to another. Since I'm also interested in systems with dependent types, I

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Iavor Diatchki
Hi, Bart Jacobs's book Categorical Logic and Type Theory has a categorical description of a system with dependent types (among others). The book is fairly advanced but it has lots of details about the constructions. Hope this helps, -Iavor On Thu, Dec 2, 2010 at 8:18 AM, rocon...@theorem.ca

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Larry Evans
On 12/02/10 11:19, Iavor Diatchki wrote: Hi, Bart Jacobs's book Categorical Logic and Type Theory has a categorical description of a system with dependent types (among others). The book is fairly advanced but it has lots of details about the constructions. Hope this helps, -Iavor Page

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Dan Doel
with dependent types, I wonder if there is a categorical description of such systems. The problem (as I see it) is that the codomain of a function depends on a value passed to the function. I'd happy if someone could give me some pointers to some papers or other literature. There are many

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Iavor Diatchki
a matter of taste. -Iavor On Thu, Dec 2, 2010 at 11:03 AM, Larry Evans cppljev...@suddenlink.net wrote: On 12/02/10 11:19, Iavor Diatchki wrote: Hi, Bart Jacobs's book Categorical Logic and Type Theory has a categorical description of a system with dependent types (among others).  The book

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Larry Evans
On 12/02/10 15:47, Iavor Diatchki wrote: Hi, You have it exactly right, and I don't think that there's a particularly deep reason to prefer the one over the other. It seems that computer science people tend to go with the (product-function) terminology, while math people seem to prefer the

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Dan Doel
On Thursday 02 December 2010 7:54:18 pm Larry Evans wrote: [snip] *Maybe* the computer science people are trying to minimize the concepts. In this case, the one concept common to both the sum and product ( in the math peoples viewpoint) is there's a function: field2type: field_name -

[Haskell-cafe] Dependent types

2010-09-10 Thread Mitar
Hi! I believe dependent types is the right term for my problem. I was trying to solve it with GADTs but I was not successful so I am turning to infinite (lazy) wisdom of Haskell Cafe. I am attaching example code where I had to define MaybePacket data type which combines different types

Re: [Haskell-cafe] Dependent types

2010-09-10 Thread Stephen Tetley
On 10 September 2010 07:14, Mitar mmi...@gmail.com wrote: But I am not sure how. Because now compiler, for example, warns me of a non-exhaustive pattern even if some MaybePacket value is not possible for given Line. This issue pops up quite quite often - Ryan Ingram's answer to it the last

Re: [Haskell-cafe] Dependent types

2010-09-10 Thread Mitar
Hi! On Fri, Sep 10, 2010 at 9:22 AM, Stephen Tetley stephen.tet...@gmail.com wrote: This issue pops up quite quite often - Ryan Ingram's answer to it the last time it was on the Cafe points to the relevant Trac issue numbers: But I have not yet made it as GADTs. I would need some help here.

Re: [Haskell-cafe] Dependent types

2010-09-10 Thread Mitar
Hi! I made it. ;-) Thanks to all help from copumpkin on IRC channel. I am attaching my solution for similar problems in future. And of course comments. Mitar Test5.hs Description: Binary data ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] dependent types

2010-04-12 Thread Ben Millwood
On Sun, Apr 11, 2010 at 10:54 PM, Jason Dagit da...@codersbase.com wrote: Or, you could use witness types: data Vehicle classification = Vehicle { ... } mkCar :: Vehicle Car mkTruck :: Vehicle Truck Then you would export the smart constructors, (mkCar/mkTruck) without exporting the Vehicle

Re: [Haskell-cafe] dependent types

2010-04-12 Thread Jason Dagit
On Mon, Apr 12, 2010 at 4:32 AM, Ben Millwood hask...@benmachine.co.ukwrote: Personally I think this approach is all rather OO. The way that seems most natural to me is: moveVehicleAcrossBridge :: Bridge - Vehicle - Maybe Move moveVehicleAcrossBridge bridge { maxWeight = max } vehicle {

Re: [Haskell-cafe] dependent types

2010-04-12 Thread Anthony Cowley
On Sun, Apr 11, 2010 at 5:54 PM, Jason Dagit da...@codersbase.com wrote: On Sun, Apr 11, 2010 at 1:59 AM, Andrew U. Frank fr...@geoinfo.tuwien.ac.at wrote: in modeling real application we have often the case that the type of some object depends on a value. e.g. small_boat is a vessel with

[Haskell-cafe] Re: dependent types

2010-04-12 Thread Maciej Piechotka
On Mon, 2010-04-12 at 12:44 -0400, Anthony Cowley wrote: On Sun, Apr 11, 2010 at 5:54 PM, Jason Dagit da...@codersbase.com wrote: On Sun, Apr 11, 2010 at 1:59 AM, Andrew U. Frank fr...@geoinfo.tuwien.ac.at wrote: in modeling real application we have often the case that the type of some

[Haskell-cafe] dependent types

2010-04-11 Thread Andrew U. Frank
in modeling real application we have often the case that the type of some object depends on a value. e.g. small_boat is a vessel with size less than a constant. big_boat is a vessel with a larger size. for example, many legal classifications are expressed in this form (e.g. car vs. truck)

[Haskell-cafe] Re: dependent types

2010-04-11 Thread Maciej Piechotka
On Sun, 2010-04-11 at 10:59 +0200, Andrew U. Frank wrote: in modeling real application we have often the case that the type of some object depends on a value. e.g. small_boat is a vessel with size less than a constant. big_boat is a vessel with a larger size. for example, many legal

Re: [Haskell-cafe] dependent types

2010-04-11 Thread Jason Dagit
On Sun, Apr 11, 2010 at 1:59 AM, Andrew U. Frank fr...@geoinfo.tuwien.ac.at wrote: in modeling real application we have often the case that the type of some object depends on a value. e.g. small_boat is a vessel with size less than a constant. big_boat is a vessel with a larger size. for

Re: [Haskell-cafe] dependent types

2010-04-11 Thread Ozgur Akgun
On 11 April 2010 22:54, Jason Dagit da...@codersbase.com wrote: ... class Vehicle a where data Car data Truck instance Vehicle Car where instance Vehicle Truck where Now you can have things that take a Car or a Truck or they can take a Vehicle instead. moveVehicle :: Vehicle v = v

Re: [Haskell-cafe] dependent types

2010-04-11 Thread Jason Dagit
On Sun, Apr 11, 2010 at 4:15 PM, Ozgur Akgun ozgurak...@gmail.com wrote: On 11 April 2010 22:54, Jason Dagit da...@codersbase.com wrote: ... class Vehicle a where data Car data Truck instance Vehicle Car where instance Vehicle Truck where Now you can have things that take a Car

[Haskell-cafe] Re: Approaches to dependent types (DT)

2010-01-11 Thread Benjamin Franksen
pbrowne wrote: Dependent Types (DT) The purpose of dependent types (DT) is to allow programmers to specify dependencies between the parameters of a multiple parameter class. 'Dependent type' means result type (of a function) can depend on argument values. This is not (directly) supported

Re: [Haskell-cafe] Re: Approaches to dependent types (DT)

2010-01-11 Thread pbrowne
of a class. Note, the notion of FD is distinct from the concept of 'Dependent types', where the result type (of a function) can depend on argument values. FD are declared in a class header, where the type of one class parameter is declared to depend on another class parameter. Consider the following

Re: [Haskell-cafe] Approaches to dependent types (DT)

2010-01-07 Thread pbrowne
Hi, I am attempting to explain an example of dependent types to computing practitioners who do not have any background in functional programming. My goal is to explain the example rather than implement or improve it. I have been told in previous postings that the approach below is a bit dated. Any

Re: [Haskell-cafe] Approaches to dependent types (DT)

2009-10-17 Thread pat browne
://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.26.4391 and ftp://ftp.cs.kun.nl/pub/CompMath.Found/HBKJ.ps.Z On Fri, Oct 09, 2009 at 02:11:30PM +0100, pat browne wrote: Hi, I am trying to understand the concept of dependent types as described in Haskell literature (Hallgren 2001),(Hinze

Re: [Haskell-cafe] Approaches to dependent types (DT)

2009-10-10 Thread Dan Doel
, so take it with salt. I am aware that dependent types can be used to express constraints on the size of lists and other collections. Technically, you don't need dependent types for this, you just need type-level naturals. But dependent types (or some sufficiently fancy faking thereof

[Haskell-cafe] Approaches to dependent types (DT)

2009-10-09 Thread pat browne
Hi, I am trying to understand the concept of dependent types as described in Haskell literature (Hallgren 2001),(Hinze,Jeuring et al. 2006). I am particularly interested in understanding two flavours of dependency mentioned by Hinze et al: 1) Types depending on values called dependent types 2

Re: [Haskell-cafe] Approaches to dependent types (DT)

2009-10-09 Thread Ryan Ingram
are: Question 1: Is my understanding correct? Question 2: What flavour of DT is this does this example exhibit? When you say Dependent Types, what is usually meant is that types can depend on *values*; for example: data Vector :: Integer - * - * where Nil :: Vector 0 a Cons :: a - Vector n

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-20 Thread Eugene Kirpichov
do not break parametricity for *unordered sets* (as opposed to lists) - turns out, not too many. 2009/5/18 Conor McBride co...@strictlypositive.org: Hi Questions of parametricity in dependent types are made more complex by the way in which the Pi-type  (x : S) - T corresponds to universal

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-20 Thread Eugene Kirpichov
Thanks, at least the title looks like exactly what I've been looking for, however I cannot quickly appreciate the notation-heavy contents: I definitely will as soon as possible. 2009/5/20 Masahiro Sakai masahiro.sa...@gmail.com: From: Eugene Kirpichov ekirpic...@gmail.com Date: Sun, 17 May 2009

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-20 Thread Conor McBride
Hi On 20 May 2009, at 07:08, Eugene Kirpichov wrote: Thanks for the thorough response. I've found BarrasBernardo's work (at least, slides) about ICC*, I'll have a look at it. Could you provide with names of works by Altenkirch/Morris/Oury/you? The unordered pair example was especially

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-20 Thread Eugene Kirpichov
Or in a language without bottoms. 2009/5/20 David Menendez d...@zednenem.com: On Sun, May 17, 2009 at 11:52 PM, Ryan Ingram ryani.s...@gmail.com wrote: Free theorem's are theorems about functions that rely only on parametricity. For example, consider any function f with the type   forall a.

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-20 Thread David Menendez
On Sun, May 17, 2009 at 11:52 PM, Ryan Ingram ryani.s...@gmail.com wrote: Free theorem's are theorems about functions that rely only on parametricity. For example, consider any function f with the type   forall a. a - a From its type, I can tell you directly that this theorem holds:  forall

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-19 Thread Masahiro Sakai
From: Eugene Kirpichov ekirpic...@gmail.com Date: Sun, 17 May 2009 23:10:12 +0400 Is there any research on applying free theorems / parametricity to type systems more complex than System F; namely, Fomega, or calculus of constructions and alike? You may be interested in this: The Theory of

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-18 Thread Conor McBride
Hi Questions of parametricity in dependent types are made more complex by the way in which the Pi-type (x : S) - T corresponds to universal quantification. It's good to think of this type as a very large product, tupling up individual T's for each possible x you can distinguish

[Haskell-cafe] Free theorems for dependent types?

2009-05-17 Thread Eugene Kirpichov
could possibly be a lot more powerful if there were a way to encode in the type of 'sort' that it accepts a reflexive transitive antisymmetric predicate, but the only way to express that is with dependent types. Looks like the only thing one needs to add to System F is the relational translation

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-17 Thread Robin Green
master's thesis, the final version of which is not quite ready yet. Basically, free theorems in the Calculus of Constructions can be substantially more complicated, because they have to exclude certain dependent types in order to be valid. So much so that I do not think that they are necessarily

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-17 Thread Eugene Kirpichov
in the Calculus of Constructions can be substantially more complicated, because they have to exclude certain dependent types in order to be valid. So much so that I do not think that they are necessarily worthwhile to use in proofs. But that is just an intuition, and I have not done enough different kinds

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-17 Thread Joe Fredette
a reflexive transitive antisymmetric predicate, but the only way to express that is with dependent types. Looks like the only thing one needs to add to System F is the relational translation rule for a dependent product; but I haven't tried doing it myself. begin:vcard fn:Joseph Fredette

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-17 Thread Ryan Ingram
::(a-a-Bool)-[a]-[a]'. The theorem could possibly be a lot more powerful if there were a way to encode in the type of 'sort' that it accepts a reflexive transitive antisymmetric predicate, but the only way to express that is with dependent types. Looks like the only thing one needs to add to System F

[Haskell-cafe] Learning GADT types to simulate dependent types

2008-06-28 Thread Paul Johnson
I'm trying to understand how to use GADT types to simulate dependent types. I'm trying to write a version of list that uses Peano numbers in the types to keep track of how many elements are in the list. Like this: {-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-} module Plist

Re: [Haskell-cafe] Learning GADT types to simulate dependent types

2008-06-28 Thread Daniel Fischer
Am Samstag, 28. Juni 2008 19:51 schrieb Paul Johnson: I'm trying to understand how to use GADT types to simulate dependent types. I'm trying to write a version of list that uses Peano numbers in the types to keep track of how many elements are in the list. Like this: {-# OPTIONS -fglasgow

Re: [Haskell-cafe] Learning GADT types to simulate dependent types

2008-06-28 Thread Dan Doel
On Saturday 28 June 2008, Paul Johnson wrote: I'm trying to understand how to use GADT types to simulate dependent types. I'm trying to write a version of list that uses Peano numbers in the types to keep track of how many elements are in the list. Like this: {-# OPTIONS -fglasgow-exts

Re: [Haskell-cafe] Learning GADT types to simulate dependent types

2008-06-28 Thread Paul Johnson
Daniel Fischer wrote: My Oleg rating isn't high either, and certainly you can do it more elegant, but class Concat l1 l2 l3 | l1 l2 - l3, l1 l3 - l2 where pConcat :: l1 a - l2 a - l3 a instance Concat (Plist Zero) (Plist n) (Plist n) where pConcat _ ys = ys instance Concat (Plist

[Haskell-cafe] ANNOUNCE: parameterized-data 0.1 - Parameterized data library implementing lightweight dependent types

2008-02-28 Thread Alfonso Acosta
This library provides an implementation of parameterized types using type-level computations to implement the type parameters and emulate dependent types. Right now only fixed-sized vectors are provided (based on Oleg's Number-parameterized types [1] and Frederik Eaton's Vectro library [2

Re: [Haskell-cafe] Re: How do I simulate dependent types using phantom types?

2007-08-19 Thread Bertram Felgenhauer
DavidA wrote: Twan van Laarhoven twanvl at gmail.com writes: The solution is to use a dummy parameter: class IntegerType a where value :: a - Integer Thanks to all respondents for this suggestion. That works great. I prefer a slightly elaborate way, newtype Mark n t = Mark t

[Haskell-cafe] How do I simulate dependent types using phantom types?

2007-08-18 Thread DavidA
) The problem with this approach is that it's not really type-safe: I can attempt to add a + b sqrt 2 to c + d sqrt 3, whereas this should be a type error because 2 /= 3. So I thought I'd have a go at doing it with phantom types. In effect I'd be using phantom types to simulate dependent types

Re: [Haskell-cafe] How do I simulate dependent types using phantom types?

2007-08-18 Thread Lennart Augustsson
it with phantom types. In effect I'd be using phantom types to simulate dependent types. Here's the code: {-# OPTIONS_GHC -fglasgow-exts #-} import Data.Ratio class IntegerType a where value :: Integer data Two instance IntegerType Two where value = 2 data Three instance IntegerType Three

Re: [Haskell-cafe] How do I simulate dependent types using phantom types?

2007-08-18 Thread Twan van Laarhoven
DavidA wrote: Hi, I am trying to implement quadratic fields Q(sqrt d). These are numbers of the form a + b sqrt d, where a and b are rationals, and d is an integer. ... class IntegerType a where value :: Integer The problem is, this doesn't work. GHC complains: The class method

[Haskell-cafe] Re: How do I simulate dependent types using phantom types?

2007-08-18 Thread DavidA
Twan van Laarhoven twanvl at gmail.com writes: The solution is to use a dummy parameter: class IntegerType a where value :: a - Integer And call it like: f = value (undefined :: Two) So for instance: instance IntegerType d = Show (QF d) where show (QF a b) = show a ++

[Haskell] (Succ Haskell') `and` $ dependent types

2007-07-14 Thread Vivian McPhail
Hello, As the authors point out [1], coal-face time needs to be expended before real world adoption of Dependently-Typed functional programming. But let's get the ball rolling. They say that haskell programmers are normally averse to dependent types. Is this true? It seems to me that one

[Haskell] Re: (Succ Haskell') `and` $ dependent types

2007-07-14 Thread Stefan O'Rear
averse to dependent types. Is this true? It seems to me that one of the appeals of Haskell is the ability to program in a prove perfect, write once (elegant) style. Is not dependent typing a good move towards this goal?. It addresses a problem [2] with which we, in our everyday common inter

Re: (Succ Haskell') `and` $ dependent types

2007-07-14 Thread Stefan O'Rear
averse to dependent types. Is this true? It seems to me that one of the appeals of Haskell is the ability to program in a prove perfect, write once (elegant) style. Is not dependent typing a good move towards this goal?. It addresses a problem [2] with which we, in our everyday common inter

[Haskell-cafe] An example of dependent types [was: Simple GADT parser for the eval example]

2006-11-01 Thread oleg
: given the expression, we compute its type -- or report a failure if the expression is ill-typed. That is, the result *type* Term a is a function of the *value* Expr. Thus is truly a problem of dependent types. And Haskell is up to it: Haskell is genuinely a dependently typed language. We show

[Haskell-cafe] Re: An example of dependent types [was: Simple GADT parser for the eval example]

2006-11-01 Thread Greg Buchholz
[EMAIL PROTECTED] wrote: Greg Buchholz has posed an interesting problem of writing a typechecker. Given untyped terms of the form ...snip... We show the solution that uses no GADTs and no representation types. We retain however the eval function in the previous message that uses GADT. Our

[Haskell] Eliminating Multiple-Array Bound Checking through Non-dependent types

2006-02-10 Thread oleg
An earlier message showed an example of writing code with non-trivial static guarantees in the present-day Haskell (i.e., Haskell98 + rank-2 types). http://pobox.com/~oleg/ftp/Haskell/types.html#branding Although this approach obviously falls short of the genuine dependent typing, we

Re: [Haskell] Dependent types, was:2-D Plots, graphical representation of massive data

2004-08-31 Thread MR K P SCHUPKE
I think you are confusing Dependent Types with Functional Dependencies. Actually the two are not that dissimilar... If we allow types to depend on types (which is what Functional Dependencies allow) IE: class a b | a - b instance Int Float instance Float Int For example

Re: [Haskell] Dependent types, was:2-D Plots, graphical representation of massive data

2004-08-28 Thread Tomasz Zielonka
On Fri, Aug 27, 2004 at 10:26:51AM -0400, Michael Manti wrote: I recognize that I'm far out of my depth here--both in Haskell and in mathematics--but I'll ask anyway. In what ways are dependent types (http://haskell.org/hawiki/FunDeps, http://www.cse.ogi.edu/~mpj/pubs/fundeps.html

RE: [Haskell] Dependent types, was:2-D Plots, graphical representation of massive data

2004-08-27 Thread Jacques Carette
occuring dependent types in mathematics. Variable names for polynomials, expansion point and 'scale' for generalized series expansions, coefficient ring for normalization and factorization of polynomials, and so on up the food chain. The dependencies get quite interesting when one is dealing

RE: [Haskell] Dependent types, was:2-D Plots, graphical representation of massive data

2004-08-27 Thread Michael Manti
I recognize that I'm far out of my depth here--both in Haskell and in mathematics--but I'll ask anyway. In what ways are dependent types (http://haskell.org/hawiki/FunDeps, http://www.cse.ogi.edu/~mpj/pubs/fundeps.html) insufficient to address these issues? On Friday, August 27, 2004, at 10

[Haskell] Re: Dependent Types in Haskell

2004-08-14 Thread oleg
Martin Sulzmann stated the goal of the append exercise as follows: ] Each list carries now some information about its length. ] The type annotation states that the sum of the output list ] is the sum of the two input lists. I'd like to give a Haskell implementation of such an append function,

[Haskell] Dependent Types in Haskell [was: Eliminating Array Bound Checking through Non-dependent] types

2004-08-11 Thread Martin Sulzmann
There's a potentially confusing typo. append Nil ys = Nil should be replaced by append Nil ys = ys Thanks to Ketil for pointing this out. Martin ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Dependent Types in Haskell [was: Eliminating Array Bound Checking through Non-dependent] types

2004-08-11 Thread MR K P SCHUPKE
Just a couple of quick points... Why store the length along with the list, the length is stored using type level naturals (Succ | Zero) but these are identical to the recursion pattern in a List (Cons | Nil) - therefore it is no less work than having a length function which converts from one to

Re: [Haskell] Dependent Types in Haskell [was: Eliminating Array Bound Checking through Non-dependent] types

2004-08-11 Thread MR K P SCHUPKE
Actually the data statement wasnt quite right: data Cons a b = Cons a b Would work, but now there is nothing keeping each element in the list as the same type, I guess we could add a class to constrain to a normal list,,, class List l x instance List Nil x instance List l x = List (Cons x l) x

Re: [Haskell] Dependent Types in Haskell [was: Eliminating Array Bound Checking through Non-dependent] types

2004-08-11 Thread Martin Sulzmann
The append example is meant to make a general point about the connection between dependent types and Haskell with extensions. I know that the example itself is rather trivial, and DML/index types, Omega, Haskell+GAD and Chameleon might seem as too big canons for a rather small target. Second

[Haskell] Re: Dependent Types in Haskell [was: Eliminating Array Bound Checking through Non-dependent] types

2004-08-11 Thread Conor T McBride
Hi Martin Martin Sulzmann wrote: Hi, Inspired by Conor's and Oleg's discussion let's see which dependent types properties can be expressed in Haskell (and extensions). I use a very simple running example. [..] We'd like to statically guarantee that the sum of the output list is the sum of the two

Re: [Haskell] Dependent Types in Haskell [was: Eliminating Array Bound Checking through Non-dependent] types

2004-08-11 Thread MR K P SCHUPKE
This will only work for terminating programs! Interesting point, but thats because all the operations are at the type level - therefore if a type is unknown at compile time we cannot produce a program. With this type class stuff values can depend on types, but not the other way around. You can

[Haskell] Dependent Types in Haskell [was: Eliminating Array Bound Checking through Non-dependent] types

2004-08-10 Thread Martin Sulzmann
Hi, Inspired by Conor's and Oleg's discussion let's see which dependent types properties can be expressed in Haskell (and extensions). I use a very simple running example. -- append.hs -- append in Haskell data List a = Nil | Cons a (List a) append :: List a - List a - List

Re: [Haskell] Eliminating Array Bound Checking through Non-dependent types

2004-08-09 Thread Conor T McBride
. The abstract `brand' is just a type-level proxy for the bounding interval, and the library of operations provides interval-respecting operations on indices. This is a very neat solution in Haskell, but it goes round an extra corner which isn't necessary with dependent types, where you can just talk about

Re: [Haskell] Eliminating Array Bound Checking through Non-dependent types

2004-08-08 Thread oleg
Hello! Bjorn Lisper wrote: What is the relation to the sized types by Lars Pareto and John Hughes? It is orthogonal and complementary, as the message in response to Conor T. McBride indicated. What is the relation to classical range analyses for (e.g.) array index expressions, which have

  1   2   >