...No surprise there, since there is no way to fail in the event of a
maltyped Expr. The next thing to try is a type class solution...
Think about it: you need to do type checking.
For our little language we used Template Haskell to do your Expr - Term a
translation, thus the type-checking of
On Wed, Oct 25, 2006 at 11:58:59AM +1000, Donald Bruce Stewart wrote:
After some discussion on the libraries list, I've put up the suggested
'best practice' for proposing library changes, here:
http://haskell.org/haskellwiki/Library_submissions
The idea is to reduce the number of
Consider the following sequence of functions
that replace a single element in an n-dimensional
list:
replace0 :: a - a - a
replace0 = const
replace1 :: Int - a - [a] - [a]
replace1 i0 x xs
| null t= h
| otherwise = h ++ (replace0 x (head t) : tail t)
where (h, t) = splitAt i0 xs
replace2
On Tue, Oct 31, 2006 at 11:02:03AM +0200, Yitzchak Gale wrote:
Consider the following sequence of functions
that replace a single element in an n-dimensional
list:
replace0 :: a - a - a
replace1 :: Int - a - [a] - [a]
replace2 :: Int - Int - a - [[a]] - [[a]]
Generalize this using type
On Oct 31, 2006, at 2:19 AM, Dimitrios Vytiniotis wrote:
-- Give a GADT for representation types
data R a where
Rint :: R Int
Rbool :: R Bool
Rpair :: R a - R b - R (a,b)
-- Give an existential type with a type representation
data TermEx where
MkTerm :: R a - Term a - TermEx
-- we
People might be interested in a new tutorial that's just appeared in
blogspace, by coffeemug (of #haskell):
http://www.defmacro.org/ramblings/lisp-in-haskell.html
Also, its on reddit, http://programming.reddit.com/info/oj1w/details
An enthusiastic view of the language from a newcomer's
Thanks for pointing it !
(There's also this one:
http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html
which is featured on the Tools and Libraries/Compilers and
Interpreters page of the haskell wiki)
bye,
minh thu
2006/10/31, Donald Bruce Stewart [EMAIL PROTECTED]:
Tomasz Zielonka wrote:
It's quite easy if you allow the indices to be put in a
single compound value.
Hmm. Well, I guess I don't need to insist on the exact
type that I gave in the statement of the puzzle - although
something like that would be the nicest.
This is actually a function that is
Hi,
On Tue, Oct 31, 2006 at 12:10:21PM +, Wouter Swierstra wrote:
* License: The entire magazine should be published under a
Creative Commons Attribution 2.5 License. This makes it much easier
to publish, distribute, teach, and share the Reader. This license
allows anyone to use
Henning Sato von Rosen wrote:
I am curious as to why Haskell not is homoiconic?
I am interested in the reasons behind that design descision.
I ask using this defintion og homiconicity:
Homiconic means that the primary representation of programs is also a
data structure in a primitive type of
Homiconic means that the primary representation of programs is also a
data structure in a primitive type of the language itself
The main reason is that Haskell is designed as a compiled
language, so the source of the programme can safely
disappear at runtime. So there's no need to have a
Henning Sato von Rosen [EMAIL PROTECTED] writes:
Hi all!
I am curious as to why Haskell not is homoiconic?
It very nearly is. The icon for Haskell is a lower-case
lambda, but the logo for these folk
http://www.ualberta.ca/~cbidwell/cmb/lambda.htm is an
upper-case lambda.
Homiconic means
Hi all!
I am curious as to why Haskell not is homoiconic?
I am interested in the reasons behind that design descision.
I ask using this defintion og homiconicity:
Homiconic means that the primary representation of programs is also a
data structure in a primitive type of the language itself --
Yitzchak Gale wrote:
Tomasz Zielonka wrote:
If you insist that each index should be given as a separate
function argument, it may be possible to achieve it using the tricks
that allow to write the variadic composition operator.
I am not familiar with that. Do you have a reference?
Is that
See
Connor McBride's Faking It: Simulating Dependent Types in Haskell
http://citeseer.ist.psu.edu/mcbride01faking.html
It might help; your example makes me think of the nthFirst function.
If it's different, I'md wager the polyvariadic stuff and nthFirst can
be reconciled on some level.
Nick
Hello,
When trying to compile a standalone
program using hdbc in cygwin, I get many linker errors.
I have no problems using my code interactively
with ghci.
I am using the command line:
ghc --make -package HDBC
-package HDBC-odbc -O -o testExecute testExecute.hs
Am I missing something?
Rearranging...
Nicolas Frisby wrote:
On 10/31/06, Greg Buchholz [EMAIL PROTECTED] wrote:
...That first article is the strangest. I couldn't reconcile the fact
that if our type signature specifies two arguments, we can pattern
match on three arguments in the function definition.
Greg Buchholz wrote:
...That first article is the strangest. I couldn't reconcile the fact
that if our type signature specifies two arguments, we can pattern
match on three arguments in the function definition. Compare the number
of arguments in the first and second instances...
class
Does that explain how, why, or when you can use more arguments than
you are allowed to use? Or is it just another example of using more
arguments than you are allowed to use? Is this a Haskell 98 thing, or
is it related to MPTCs, or fun deps, or something else?
I don't understand you can
Hello,
I think my problem is a faulty
ghc installation and not HDBC.
sorry for the noise,
Jeff
[EMAIL PROTECTED] wrote on 10/31/2006
02:31:27 PM:
Hello,
When trying to compile a standalone program using hdbc in cygwin,
I
get many linker errors.
I have no problems using my code
On Tue, Oct 31, 2006 at 03:12:53PM +0200, Yitzchak Gale wrote:
But I would rather not be forced to write things like
replace (I 0 $ I 2 $ I 3 $ ())
in my code. My first attempt was very similar to yours,
except I used
replace (0, (2, (3, (
instead of your Index type.
I started
Arie Peterson wrote:
] I'm not sure I'm getting your point, but this is just because in the
] second instance, the second parameter of BuildList is 'a - r', so the
] specific type of 'build\'' is '[a] - a - (a - r)' which is just '[a] -
] a - a - r' (currying at work).
I guess it just looks
Daniel McAllansmith [EMAIL PROTECTED] writes:
Hello.
I have some html from which I want to extract records.
Each record is represented within a number of tr nodes, and all records
tr
nodes are contained by the same parent node.
This is very poorly written HTML. The original structure
Greg Buchholz wrote:
I guess it just looks really strange to my eyes. For example, foo
and bar are legal, but baz isn't. That's what I was thinking of the
situation, but I guess the type classes iron out the differences.
foo :: Int - Int - Int - Int
foo 0 = (+)
bar :: Int - Int - Int
Greg Buchholz wrote:
I guess it just looks really strange to my eyes. For example, foo
and bar are legal, but baz isn't. That's what I was thinking of the
situation, but I guess the type classes iron out the differences.
Ah, but here 'baz' is illegal because of the (somewhat arbitrary)
Thanks to everyone who replied (especially Dimitrios Vytiniotis and
Joost Visser). I now know the standard way to write the GADT parser.
But I'm still curious if anyone has comments pertaining to the version
using type classes. It seems so close to doing what we want, and it is
pretty
To boost the popularity of Scheme, Felleisen has argued for renaming
lambda to something cool, such as Funster.[1] Likewise, Haskell
intimidates newcomers with the arcane term monad. Peyton Jones's
hopeful campaign to replace it with warm fuzzy thing[2] has so far
produced few results. Inspired
On Mon, 30 Oct 2006, David House wrote:
On 30/10/06, Tony Morris [EMAIL PROTECTED] wrote:
4) If you want links to base libraries in your haddock output, do such
and such (how do you do that anyway?)
I believe you need a local copy of the library sources, whose path you
give to haddock
28 matches
Mail list logo