Ela Platform 2016.3 is an iterative release that focuses on Ela standard library. The major change is an addition of a "measure" module that
provides a support for measurement units in Ela.
This platform also comes with updated versions of Ela and Elide and expands Ela documentation.
What's new in this release:
Download:
--
---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Module file is an unsafe module and it is located in unsafe folder. So you should reference it like so:
open unsafe.file
--
---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Because there is an error in the library function J
You can manually change it to be as follows:
writeLines xs fl = io.truncateFile fl `seq` write (force xs)
where f = force fl
write (x::xs) = io.writeLine x f `seq` write xs
write [] = ()
I will include a fix in the next release.
Anyway module “file” is a rather old unsafe module and at the moment you would probably prefer to use IO monad instead.
For example, you can implement a “writeLines” function with the same behavior like so:
open monad io
//Function is written using do-notation with io monad
writeLines xs fn = do
fh <- writeFile fn OpenCreateMode
writeLines xs fh
closeFile fh
where
writeLines [] _ = return ()
writeLines (x::xs) fh = do
writeStr (x ++ "\r\n") fh
writeLines xs fh
//Usage
writeLines ["123", "abc", "defg"] "c:\\test\\output.txt"
--
---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Again this is an error. This module haven’t been used for quite a while hence the load of bugs in it.
You can change this function to be as follows:
readLines !fl =
let fh = io.openFile fl "OpenMode" "ReadAccess" in
let str = io.readLines fh in
io.closeFile fh `seq` str
It won’t work as a map though, and will return lines as a string, not as a list.
This will be also included in the next release.
Ela Platform 2016.3 is an iterative release that focuses on Ela standard library. The major change is an addition of a "measure" module that
--
---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yes, this is a bug in integer module. I’ll take a look at it.
From: ela...@googlegroups.com [mailto:ela...@googlegroups.com] On Behalf Of Tikhonov Alexey
Sent: Monday, May 30, 2016 7:22 AM
To: ela...@googlegroups.com
Subject: Re: Ela Platform 2016.3 is released
Hello!
A fix is in repo, in module integer. To be included in the next version.
From: ela...@googlegroups.com [mailto:ela...@googlegroups.com] On Behalf Of Tikhonov Alexey
Sent: Monday, May 30, 2016 7:22 AM
To: ela...@googlegroups.com
Subject: Re: Ela Platform 2016.3 is released
Hello!
a = multByScalar base 1 [1,1] //Try to comment
b = mult 10 [1] [1,1]
in b
//////////
It produces result:
[1,1,1]
//a = multByScalar base 1 [1,1] //Try to comment
b = mult 10 [1] [1,1]
in b
//////////
I get another result:
[1,1]
Ela Platform 2016.3 is an iterative release that focuses on Ela standard library. The major change is an addition of a "measure" module that
--
---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
It’s not an impure behavior, but looks like some kind of a shadowing issue. Multiplication references Summation which defines functions of the same name. Somehow a different implementation is chosen depending on the comment. I believe everything would work correctly if you declare these functions as qualified (e.g. sum # qualified)?
I will look deeper into this.