Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: invalid type signature last2::: [a] -> a (Roelof Wobben)
2. First Project: Imperative Algorithm Visualization tool
(Adit Biswas)
3. Re: First Project: Imperative Algorithm Visualization tool
(Kim-Ee Yeoh)
4. Re: invalid type signature last2::: [a] -> a (Jeffrey Brown)
----------------------------------------------------------------------
Message: 1
Date: Sun, 09 Nov 2014 14:11:12 +0100
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] invalid type signature last2::: [a]
-> a
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20141109/6fa6a42f/attachment-0001.html>
------------------------------
Message: 2
Date: Sun, 9 Nov 2014 23:19:48 +0530
From: Adit Biswas <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] First Project: Imperative Algorithm
Visualization tool
Message-ID:
<CAKX3rZi3g==byDjxt5sC856T7Dx=enufp5or84v6zu9a6cg...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
I'm kindoff a beginner in haskell, I've mostly just been exploring the
language, some of the introductory books on the subject and writing
some small programs.
This is one of my first projects I wanted to try out, but I'm feeling
a bit lost on how to go about doing it. I want to build a tool which
takes in inputs describing algorithms, probably in their imperative
form and generate animations using SVG and HTML5 preferably or OpenGL.
I find that being able to visualize the execution of an algorithm
helped me understand the material a few years ago when i started
college but I mostly had to do these on pen and paper.
So my higher level idea on approaching this problem is:
1. Create a dsl for describing data structures, e.g Link lists,
trees, graphs
2. Create a dsl for describing each step of the algorithms
manipulating the data structures
3. The algorithms would be a monadic composition of the step ADTs
4. Lift the algorithm to some monad which carries out the side
effects of making changes to a visualization.
I'm sorry if I didn't use all the correct terminology for describing
the problem, I'm not completely sure if it's an appropriate approach.
My logic was that Since each state of the visualization is a
sideeffect of executing an algorithm, it would be a seperate monad
like IO, the entire algorithm can be represented as some form of a
graph, I should have data types representing each component of the
graph.
I have no idea how to go about designing a DSL or for designing a
monad which will handle the animations. Could someone help me approach
the solution and what topics I want to look at to understand how to
build the solution. Feel free to let me know if you'd like to help
work on the tool, or if you think I should simplify my project in some
way. This is mostly just an idea for a project and since I'm feeling
pretty beginnerish with the language, i wouldnt love suggestions on a
simpler project which can sorta lead me in a direction in which i can
make this tool in the future. Thank You!
--
Adit Biswas
------------------------------
Message: 3
Date: Mon, 10 Nov 2014 01:03:48 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] First Project: Imperative Algorithm
Visualization tool
Message-ID:
<CAPY+ZdQLD_96Y9wdZW0=cpydjs4jn2tx_xshnwqvdvbbfme...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Mon, Nov 10, 2014 at 12:49 AM, Adit Biswas <[email protected]> wrote:
> I have no idea how to go about designing a DSL or for designing a
> monad which will handle the animations.
>
Is it really about DSLs and monads?
Or is it first getting a grasp of the problem space?
You're trying to chew everything at once in a first bite. Scope out the
smallest meaningful chunk and use that experiential learning to direct
where to go next.
"If you can't solve a problem, then there is an easier problem you can
solve: find it." -- Polya
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20141110/438191f7/attachment-0001.html>
------------------------------
Message: 4
Date: Sun, 9 Nov 2014 11:05:39 -0800
From: Jeffrey Brown <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] invalid type signature last2::: [a]
-> a
Message-ID:
<caec4ma1idttst6joqwhsbzn960qb-xrytx-sb4_ubcacdxv...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Have you read this
<http://ics.p.lodz.pl/~stolarek/_media/pl:research:stolarek_understanding_basic_haskell_error_messages.pdf>?
I found it fascinating, helpful, and (perhaps unlike most papers out there
on Haskell) not at all difficult to read quickly.
On Sun, Nov 9, 2014 at 5:11 AM, Roelof Wobben <[email protected]> wrote:
> Thanks,
>
> Now when I run it, I see a error message that main is missing.
> and I cannot find in theIlearnyouahaskell how to solve this.
>
> Roelof
>
>
>
>
> May Khaw schreef op 9-11-2014 11:17:
>
> The first one means that you gave a type signature for a function you did
> not define.
>
> The second one means that there are 2 last2 type signature, but you can
> only have one.
>
> What you want is something like :
> last2 :: [a] - > a
> last2 list = (put your function here)
>
> On Sun, 9 Nov 2014 21:02 Roelof Wobben <[email protected]> wrote:
>
>> Thanks,
>>
>> I changed it to this :
>>
>> last2::[a]-> a
>> last2::last[a]
>>
>> but now I see these error messages:
>>
>> src/Main.hs@1:1-1:6 The type signature forlast2 lacks an accompanying
>> binding
>> src/Main.hs@2:1-2:6 Duplicate type signatures for last2
>> at
>> /home/app/isolation-runner-work/projects/75679/session.207/src/src/Main.hs:1:1-5
>>
>>
>> /home/app/isolation-runner-work/projects/75679/session.207/src/src/Main.hs:2:1-5
>> src/Main.hs@2:1-2:6
>> The type signature for last2 lacks an accompanying binding
>>
>>
>>
>> akash g schreef op 9-11-2014 10:48:
>>
>> The naming convention for variables and functions is that they should
>> start with a lower case letter. Types have capitalized names.
>>
>>
>> On Sun, Nov 9, 2014 at 3:12 PM, Roelof Wobben <[email protected]> wrote:
>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Hello,
>>>
>>> I try to solve the 99 haskell problems on several ways.
>>>
>>> But my first try which looks like this :
>>>
>>> Last2::[a]-> a
>>> Last2:: last[list]
>>>
>>> gives the following error message :
>>>
>>> src/Main.hs@1:1-1:6
>>> Invalid type signature: Last2 :: [a] -> a Should be of form <variable>
>>> :: <type>
>>>
>>> What am trying to do is say the input is a list which can be of integers
>>> or chars so everything is the output can then also be of type everything.
>>>
>>> Roelof
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Beginners mailing list
>>> [email protected]
>>> http://www.haskell.org/mailman/listinfo/beginners
>>>
>>>
>>
>>
>> _______________________________________________
>> Beginners mailing
>> [email protected]http://www.haskell.org/mailman/listinfo/beginners
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>
>
> _______________________________________________
> Beginners mailing
> [email protected]http://www.haskell.org/mailman/listinfo/beginners
>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20141109/b5917284/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 77, Issue 3
****************************************