Compile error for 2048 game example

103 views
Skip to first unread message

rpjh...@gmail.com

unread,
Oct 6, 2014, 12:24:26 AM10/6/14
to idris...@googlegroups.com
I am running the pre-built Idirs 64-bit binary for my Windows 8 notebook. I was able to get the hello world example running.

I tried to compile the 2048 example by Kester Tong (https://github.com/KesterTong/idris2048/blob/master/README.md), and received this error:

Effects.idr:48:35:When elaborating type of Main.rndFin':
When elaborating argument ce to type constructor Effects.Eff:
        Can't unify
                Vect (S n) a
        with
                m -> List EFFECT

        Specifically:
                Can't unify
                        Vect (S n)
                with
                        \{uv0} => m -> uv

I am new to functional programming, and Idris. Any tips would be appreciated. Are there any caveats about using the Windows pre-built binary? Thank you.

Robert


Robert

unread,
Oct 6, 2014, 2:14:48 AM10/6/14
to idris...@googlegroups.com
I tried reading the Effects.idr file for the error reference line and column number, but all of the files in the folder are of a *.ibc extension, not *.idr.

Ramon Snir

unread,
Oct 6, 2014, 3:13:08 AM10/6/14
to idris...@googlegroups.com
I'm not working with Idris regularly and didn't see the error while skimming rndFin''s code, but here's the source of Effects.idr, in case it helps you:


--
You received this message because you are subscribed to the Google Groups "Idris Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idris-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Edwin Brady

unread,
Oct 6, 2014, 3:20:52 AM10/6/14
to idris...@googlegroups.com
Hi,
The Effects library has changed a few times, and it looks like it requires an older version. To update the code for the latest version, anywhere you see “Eff m a”, try updating it to “Eff a” (i.e. remove the first argument). This should probably work.

Edwin.

Robert

unread,
Oct 6, 2014, 9:21:57 AM10/6/14
to idris...@googlegroups.com
The man himself! Thanks for the quick reply, however, I think I need to step aside and learn a bit more about Idris before trying to run somebody else's code. I understand the gist of the older library calling methods in the code, but I can't connect the dots on this one. I am sure I'll have more questions as I work through my own examples.

Rob

Kester Tong

unread,
Oct 6, 2014, 4:45:56 PM10/6/14
to idris...@googlegroups.com
Hi Rob,

As Edwin said, I haven't updated my code to use the latest version of the Effects library.  I'll try and update it sometime this week.

Kester

Robert

unread,
Oct 7, 2014, 1:13:14 AM10/7/14
to idris...@googlegroups.com
Thanks! I just started with Idris, and your code seemed to be just short enough and an engaging subject for me - games - that I dove in. I really need to hone my functional chops first. I am fascinated with Idris because I am also self-teaching higher mathematics, and I see its logical base as a good fit. I appreciate your efforts.

Rob

Robert

unread,
Oct 8, 2014, 7:31:31 AM10/8/14
to idris...@googlegroups.com
One last thing: any issues with using the pre-built binaries for Windows 64 bit vs. a Linux or Mac OS X build? Libraries, etc... Thanks!

Rob

Kester Tong

unread,
Oct 13, 2014, 2:25:18 PM10/13/14
to idris...@googlegroups.com
Hi Rob,

The idris2048 repo should work with the latest version of Idris now.  I'm doubt there are any Windows specific issues in my code, except that the behavior when reading from the keyboard (when actually playing the game) might differ.  e.g. on my mac you have to press enter after each command.  This isn't really anything to do with Idris, it's just that the standard methods for getting keyboard input aren't designed for playing games where you enter commands one key at a time.

Kester

Larry Marburger

unread,
Oct 14, 2014, 7:09:08 AM10/14/14
to idris...@googlegroups.com
Thanks, Kester! I've been referencing this code a lot as I've been learning Idris.

Kester Tong

unread,
Oct 14, 2014, 10:23:30 PM10/14/14
to idris...@googlegroups.com
Thanks Larry, I'm glad it was helpful.

On Tue, Oct 14, 2014 at 7:09 AM, Larry Marburger <lmarb...@gmail.com> wrote:
Thanks, Kester! I've been referencing this code a lot as I've been learning Idris.

--
You received this message because you are subscribed to a topic in the Google Groups "Idris Programming Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/idris-lang/qjaoVsU54rA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to idris-lang+...@googlegroups.com.

Robert

unread,
Oct 23, 2014, 12:40:14 AM10/23/14
to idris...@googlegroups.com
Thank you! That works. Sorry for the late reply. Now, on with Idris...
Reply all
Reply to author
Forward
0 new messages