Re: [frege-programming-language] I'm confused…

2016-06-17 Thread Dierk König
Hi Russel,

I guess you are using the Frege Gradle Plugin.
You may need to update to the latest version.

cheers
Dierk

> Am 14.06.2016 um 10:59 schrieb Russel Winder :
> 
> In my Gradle build, if I have:
> 
>dependencies {
>  compile 'org.frege-lang:frege:3.23.+'
>…
> 
> then my:
> 
>   (usejdk8 && ./gradlew)
> 
> works fine. If however I have:
> 
>dependencies {
>  compile 'org.frege-lang:frege:3.24.+'
>…
> 
> Then I get:
> 
> :compileJava UP-TO-DATE
> :compileFrege
> Error: Could not find or load main class frege.compiler.Main
> :compileFrege FAILED
> 
> FAILURE: Build failed with an exception.
> 
> --
> 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [frege-programming-language] I'm confused…

2016-06-21 Thread Dierk König
That needs update as well
https://plugins.gradle.org/plugin/org.frege-lang

Dierk

sent from:mobile 

> Am 17.06.2016 um 16:32 schrieb Russel Winder :
> 
>> On Fri, 2016-06-17 at 11:03 +0200, Dierk König wrote:
>> Hi Russel,
>> 
>> I guess you are using the Frege Gradle Plugin.
> 
> Definitely, is there any other way of doing things? ;-)
> 
>> You may need to update to the latest version.
> 
> I am using 0.5 as it tells me on the GitHub front page for the
> repository.
> 
> -- 
> 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] I clearly do not understand IO in Frege (and Haskell)

2016-06-22 Thread Dierk König
this may help:
https://github.com/Dierk/Real_World_Frege/blob/4990299eeaa6358751eb780bec3ddb125565a413/src/main/frege/realworld/chapter4/C_FixLines.fr

In fact, all of chapter 4 is about that issue.

Please feel free to update or change the solutions.

cheers
Dierk

> Am 22.06.2016 um 13:22 schrieb Russel Winder :
> 
> Has any one got an example of a function that reads a file and splits
> it into words such that:
> 
> loadFile :: String -> [String]
> 
> or even better returns a Set of Strings. Or some such that I may learn
> how to properly handle results from do blocks and IO monads.
> 
> --
> 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [frege-programming-language] I clearly do not understand IO in Frege (and Haskell)

2016-07-11 Thread Dierk König
I agree with Russel.
This is why I chose the approach of 
https://dierk.gitbooks.io/fregegoodness/content/
where I focus on the benefits without diving too much into theory and jargon.
(anyway some have reported to have understood monads from that resource
even though the word does not even appear ;-))

If we have more examples that we can add to the "Easy IO" chapter,
I'd be happy to take the pull request.

cheers
Dierk


> Am 11.07.2016 um 11:08 schrieb Russel Winder :
> 
> On Wed, 2016-06-22 at 22:37 +1000, Tony Morris wrote:
>> It is incorrect to think of the String has having been extracted. It
>> is
>> incorrect to think that the IO in (IO String) has been removed in a
>> do
>> block.
> 
> Agreed but I am trying to find the "little white lie" that allows Java
> people to be productive in Haskell/Frege within a couple of hours.
> 
>> It is my opinion that covering this topic comprehensively requires
>> significant build-up material since other fundamental subjects are
>> necessary to achieve a reasonable understanding. For example,
>> NICTA/course first encounters questions like these on day 3 after
>> having
>> solved hundreds of other problems prior.
>> 
>> https://github.com/NICTA/course/blob/master/src/Course/FileIO.hs
> 
> The problem with getting traction of ideas with the majority of working
> programmers is that you have to give them working codes they can
> understand within a few minutes. Purity founded functional programming
> does not capture most of them's imagination, they are looking how to
> deal with the declarative style of Java 8, and if we are really lucky
> Kotlin, and even Ceylon. It is highly unlikely these people will ever
> do a 3 or 4 day course on Haskell of Frege without being hooked first.
> They need the inspiration stuff in 90 to 180 mins.
> 
>> The only quick cheat I can conceive is to set out with some tasks
>> using
>> the Free monad, to truly observe the difference between the grammar
>> (functor) and then the interpreter for that grammar.  In the case of
>> IO,
>> we (programmers) never get to manipulate or even see that
>> interpreter,
>> only invoke it. Understanding this distinction is necessary to
>> comprehending concepts herein.
> 
> I'll have to take a peek down that route, but without words like monad,
> functor, etc. as most Java programmers have already been trained to
> treat these as fear words with the Monty Python solution "run away, run
> away".
> 
> --
> 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [frege-programming-language] Re: Documenting stuff…

2016-07-13 Thread Dierk König
The gradle plugin has a fregeDoc task. 

Cheers
Dierk

sent from:mobile 

> Am 13.07.2016 um 18:47 schrieb Russel Winder :
> 
>> On Tue, 2016-07-12 at 09:37 -0700, Ingo W. wrote:
>> X is frege.tools.Doc
> 
> That is going to require a Bash script to make a command. Or I guess a
> Gradle target would suffice. Has anyone already done either of these?
> 
> -- 
> 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Re: Hello World won't say hello

2016-09-23 Thread Dierk König
I'm currently on the road but may have time early next week to look into the 
issue. 

Cheers
Dierk

sent from:mobile 

> Am 23.09.2016 um 03:32 schrieb Russel Winder :
> 
>> On Thu, 2016-09-22 at 15:01 -0700, Ingo W. wrote:
>> The message tells me, that in the command gradle runs for 
>> "fregeCompilation", there is obviously no frege compiler in the
>> classpath.
>> And now I wonder what command it actually did run.
> 
> I'll post this as a bug in the Frege Gradle plugin. 
> 
> Clearly the 0.8 plugin must be working for some people, so the question
> is what have I done that stops it.
> 
> -- 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Using FregIDE

2016-10-04 Thread Dierk König
For some simple examples, I would go with a "manual" setup of the eclipse 
project, i.e. have the plugin, make a new Java project, and enable Frege 
Builder. 
That always works for me to get the IDE support. 
Putting Maven/Gradle into that mix occasionally breaks things and sometimes 
requires project close/open or eclipse restarts (?)

For Fibonacci and other small stuff, manual setup should be sufficient. 
When more dependencies are involved, I build via gradle. 

Cheers
Dierk

sent from:mobile 

> Am 04.10.2016 um 16:22 schrieb Russel Winder :
> 
> I will be using the Factorial program as an introduction to using
> QuickCheck. However I have just discovered that FregIDE seems unable to
> cope with Gradle/Maven structured projects. I guess this is that the
> default class path for a Java project is not working for a Frege
> project in Gradle structure.
> 
> Personally I use IntelliJ IDEA and avoid Eclipse if at all possible,
> but I know there are many Eclipse addicts. It would this be good if I
> could show this working in Eclipse as well as IntelliJ IDEA and Emacs –
> Vi, Atom, SublimeText, NetBeans are left as an exercise for the
> student.
> 
> Any help most welcome.
> 
> -- 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] FregIDE and running QuickCheck

2016-10-04 Thread Dierk König
Make a run config for a Java Application that starts tools.QuickCheck. Let the 
main args point to your tests. 

Cheers
Dierk

sent from:mobile 

> Am 04.10.2016 um 16:43 schrieb Russel Winder :
> 
> Hi,
> 
> Is there a paragraph somewhere about setting up a run configuration in
> FregIDE for executing QuickCheck tests. I found the one for running
> code (after being embarrassed in a previous email thread :-) but
> (unless I am just being blinded by worry) I can't see the data needed
> for a testing configuration.
> 
> -- 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] NaN literal

2016-10-04 Thread Dierk König
https://dierk.gitbooks.io/fregegoodness/content/src/docs/asciidoc/what.html

> Am 04.10.2016 um 18:19 schrieb Russel Winder :
> 
> Is there a NaN literal anywhere defined in Frege.
> 
> I have been blundering about but can't seem to find one.
> 
> Alternatively infinity.
> 
> --
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [frege-programming-language] Testing things

2016-10-06 Thread Dierk König
Sure, use the "once" method. 

Cheers
Dierk

sent from:mobile 

> Am 06.10.2016 um 15:34 schrieb Russel Winder :
> 
> Given we have QuickCheck but no HUnit, is there a way of getting
> QuickCheck to run one rather than 100 tests of a property since the
> property is nullary and only needs to be run once to fully test the
> property.
>   
> -- 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Types inferred and otherwise

2016-10-07 Thread Dierk König
I assume your implementation requires division and therefore Real. 
Frege is not easily fooled :-)

Cheers
Dierk

sent from:mobile 

> Am 07.10.2016 um 17:04 schrieb Russel Winder :
> 
> As I understand it, Haskell and Frege idiom is to provide a type
> signature for a function, at least ones exported from a module. However
> is this always going to be possible. However…
> 
> In trying to write a model answer median function (as opposed to just
> "stealing" the one on Rosetta Code) I have a function:
> 
> median xs = …
> 
> This works fine without a type signature. The body of the code only
> relies on the list being sortable, thus it would seem that:
> 
> median :: Ord a => [a] -> a
> median xs = …
> 
> is the right signature. Except that this now gives me a compilation
> error because the inferred type is "Real a => [a] -> a". For me Real is
> consistent with Ord and so should match but the compiler states
> otherwise.
> 
> I am clearly missing something. The obvious workaround is not to have a
> type signature…
>  
> 
> 
> I note that most of the Haskell codes on Rosetta Code are missing type
> signatures.
> 
> -- 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Re: This error message is brilliant :-(

2016-10-08 Thread Dierk König
I can hardly tell how much I like that comment! ;-)

But it takes quite some background to appreciate the correspondence between 
logic, set theory, type systems, and the barbers paradox.

Dierk

> Am 08.10.2016 um 11:49 schrieb Ingo W. :
> 
> A barber in a small village boasts about himself that he shaves all men that 
> do not shave themselves.
> 
> If we assume the barber shaves himself, we must conclude he doesn't shave 
> himself.
> If we assume the barber doesn't shave himself, we must conclude he does shave 
> himself.
> 
> Go figure.
> 
> 
> Am Samstag, 8. Oktober 2016 10:30:38 UTC+2 schrieb Russel Winder:
>> 
>> I was tinkering with the factorial code tests, I am not sure the actual 
>> code matters, and I got this error message: 
>> 
>> E 
>> /home/users/russel/Progs/Applications/Factorial/Frege/src/test/frege/factorial_test.fr:17:
>>  type error in expression 
>> iterative 
>> type is : Int 
>> expected: Integer 
>> E 
>> /home/users/russel/Progs/Applications/Factorial/Frege/src/test/frege/factorial_test.fr:17:
>>  type error in expression 
>> iterative 
>> type is : Integer 
>> expected: Int 
>> 
>> Methinks we have a new mini-episode for Joseph K in The Trial. 
>> 
>> -- 
>> Russel. 
>> =
>>  
>> Dr Russel Winder  t: +44 20 7585 2200   voip: 
>> sip:russel.win...@ekiga.net 
>> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk 
>> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] FlatMap?

2016-10-08 Thread Dierk König
It is the classic
>>=
operator or use the "do" notation. 
For the special case of lists, a list comprehension might also be appropriate. 
Check out FregeGoodness again. 

Dierk

sent from:mobile 

> Am 08.10.2016 um 17:25 schrieb Russel Winder :
> 
> I think I am getting a bit stressed :-(
> 
> I am not finding a flatMap function in Frege or Haskell. Obviously I
> can do a
> 
>foldr (++) [] $ map …
> 
> for a list of lists, but then there is the general case.
> 
> -- 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] FlatMap?

2016-10-08 Thread Dierk König
Lengthy explanation here: 
https://dierk.gitbooks.io/fregegoodness/content/src/docs/asciidoc/fpath.html

Dierk

sent from:mobile 

> Am 08.10.2016 um 17:25 schrieb Russel Winder :
> 
> I think I am getting a bit stressed :-(
> 
> I am not finding a flatMap function in Frege or Haskell. Obviously I
> can do a
> 
>foldr (++) [] $ map …
> 
> for a list of lists, but then there is the general case.
> 
> -- 
> Russel.
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Future of Frege editors/IDEs

2017-02-01 Thread Dierk König
visual studio code would even allow writing the language service in Frege 
itself.
The "language server" approach makes that possible.

cheers
Dierk


> Am 31.01.2017 um 16:36 schrieb Abhinav Sharma :
> 
> I'd like to suggest Visual Studio Code as a valid alternative to Atom since, 
> the latter has a tendency to hang and get even slower with more plugins. 
> However, VsCode being written in TypeScript is more a valid solution - 
> perhaps we might be able to use the GHCjs for writing the proper bindings and 
> build upon that work. 
> 
> They made a simpler design decision regarding the concept of language server 
> which might prove to be even more useful. 
> 
> Please do take a leighweight editor in consideration - MS is putting a lot of 
> work to make this a dev. env. for the dotNET core VM. They'll keep improving 
> it blazingly fast.
> 
> On Wednesday, October 14, 2015 at 11:57:55 PM UTC+5:30, Ingo W. wrote:
> It turned out that the eclipse plugin is starting to experience problems with 
> newer eclipse versions.
> 
> I guess I can fix it for this time. But it will probably happen again and 
> again.
> 
> Here is a list of options I see:
> 
>   • Stay with the successor of IMP. Pro: low effort. Contra: This seems 
> to be a one man show.
>   • Wrte an eclipse plugin from scratch, using latest Eclipse technology. 
> Pro: future-proof. Contra: who can do this? 
>   • Wrte an IDEA plugin from scratch, using latest Eclipse technology. 
> Pro: future-proof. Contra: who can do this? 
>   • Wrte a NetBeans plugin from scratch, using latest Eclipse technology. 
> Pro: ???. Contra: who can do this? Who uses NetBeans anyway?
>   • Roll your own in FregeFX. Pro: Dierk has the know how. Stand alone 
> product. Contra: stand-alone product 
>   • Use ATOM or something like that. Pro: attract the cool kids. Contra: 
> would need indirect interfacing with compiler (i.e. via pipes or sockets). 
> Could be cool, though, once we had it.
> Non-options:
> 
> Use emacs.
> 
> (Haha, I'm joking. But then I'd prefer VIM)
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Gradle Frege plugin and frege-java-frege dependency

2017-09-02 Thread Dierk König
Hi Markus,

bi-directional dependencies are always a bit difficult with alternative JVM 
languages but there are two ways to address this:

a) shared interface
The trick is to extract a shared Java interface and compile this in an extra 
(gradle) project, say "shared".
Then you let your core project depend on "shared". You can even split up your 
core project into
"java" and "frege" and let either depend on "shared".
Granted, this is a bit of setup work, but it somewhat models the dependencies 
nicely
and Gradle supports multi-project builds really well.

b) inline Java
You can inline your Java code right inside your Frege module files and they 
will be compiled together
in the same fashion that the Java compiler resolves bidirectional dependencies 
between two Java files.

Please let me know if that works for you.

Cheers
Dierk


> Am 02.09.2017 um 13:09 schrieb 'gulp21' via Frege Programming Language 
> :
> 
> Hi,
> 
> I’m trying to port my Frege projects from using makefiles to gradle,
> using the Frege gradle plugin. It works well for pure Frege projects and
> mixed Java and Frege projects in which the Frege code depends on the
> Java code. But now I have a project where Frege code depends on Java
> code and this Java code depends on another Frege file (see [1] for a
> minimal example). I couldn’t figure out how to make this work with the
> Frege gradle plugin, which always wants to compile the Java code first
> (which of course fails because the classes from the Frege code are
> missing). Do you have any advice on how to get this working?
> 
> Regards
> Markus
> 
> [1] https://github.com/mabre/gradle_frege_test
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Gradle Frege plugin and frege-java-frege dependency

2017-09-08 Thread Dierk König
cool.

Keep us posted about your progress :-)

cheers
 Dierk

> Am 08.09.2017 um 11:56 schrieb support.gulp21 via Frege Programming Language 
> :
> 
> Hi Dierk,
> 
> Inline Java did the trick for me. Thank you.
> 
> Regards
> Markus
> 
> Am Samstag, 2. September 2017 16:40:24 UTC+2 schrieb Dierk Koenig:
> Hi Markus, 
> 
> bi-directional dependencies are always a bit difficult with alternative JVM 
> languages but there are two ways to address this: 
> 
> a) shared interface 
> The trick is to extract a shared Java interface and compile this in an extra 
> (gradle) project, say "shared". 
> Then you let your core project depend on "shared". You can even split up your 
> core project into 
> "java" and "frege" and let either depend on "shared". 
> Granted, this is a bit of setup work, but it somewhat models the dependencies 
> nicely 
> and Gradle supports multi-project builds really well. 
> 
> b) inline Java 
> You can inline your Java code right inside your Frege module files and they 
> will be compiled together 
> in the same fashion that the Java compiler resolves bidirectional 
> dependencies between two Java files. 
> 
> Please let me know if that works for you. 
> 
> Cheers 
> Dierk 
> 
> 
> > Am 02.09.2017 um 13:09 schrieb 'gulp21' via Frege Programming Language 
> > : 
> > 
> > Hi, 
> > 
> > I’m trying to port my Frege projects from using makefiles to gradle, 
> > using the Frege gradle plugin. It works well for pure Frege projects and 
> > mixed Java and Frege projects in which the Frege code depends on the 
> > Java code. But now I have a project where Frege code depends on Java 
> > code and this Java code depends on another Frege file (see [1] for a 
> > minimal example). I couldn’t figure out how to make this work with the 
> > Frege gradle plugin, which always wants to compile the Java code first 
> > (which of course fails because the classes from the Frege code are 
> > missing). Do you have any advice on how to get this working? 
> > 
> > Regards 
> > Markus 
> > 
> > [1] https://github.com/mabre/gradle_frege_test 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Frege Programming Language" group. 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to frege-programming-language+unsubscr...@googlegroups.com. 
> > For more options, visit https://groups.google.com/d/optout. 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] co-routine support in Frege?

2017-11-17 Thread Dierk König
Cool. 
You can just use “data” in replacement of “newtype”. It makes no difference to 
the generated code. 

It would be cool to hear more about your project!

Cheers
Dierk

sent from:mobile 

> Am 17.11.2017 um 11:13 schrieb zhou6...@163.com:
> 
> In scheme, I can implement my co-routine by defining a function like this:
> 
> (define (spawn prog)
>  (call/cc
>   (lambda (start)
> (let ((suspend (lambda ()
> (call/cc
>  (lambda (k)
>(start k))
>   (prog suspend)
> 
> Recently I use Frege to program android, I notice that  Control.Monad.Cont is 
> not available, I try to define it follow the book 
> https://en.wikibooks.org/wiki/Haskell/Continuation_passing_style
> 
> newtype Cont r a = Cont { runCont :: ((a -> r) -> r) } -- r is the final 
> result type of the whole computation 
>  
> instance Monad (Cont r) where 
> return a   = Cont $ \k -> k a   -- i.e. return a 
> = \k -> k a 
> (Cont c) >>= f = Cont $ \k -> c (\a -> runCont (f a) k) -- i.e. c >>= f = 
> \k -> c (\a -> f a k)
> 
> But no luck, 'newtype' is not supported by Frege
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Re: Cont monad defined in Frege

2017-11-22 Thread Dierk König
Cool! Bring it on!

Dierk

sent from:mobile 

> Am 23.11.2017 um 03:10 schrieb zhou6...@163.com:
> 
> The code is working on my 3.24.100 Frege Repl, and I am trying to reinvent 
> ContT monad transformer in Frege now, hope I can learn more about Haskell
> 
> 在 2017年11月23日星期四 UTC+8上午10:07:07,zhou...@163.com写道:
>> 
>> No big deal, only recording my progress striving to understand monad and 
>> monad transformer with this tutorial 
>> https://en.wikibooks.org/wiki/Haskell/Continuation_passing_style and this 
>> https://wiki.haskell.org/All_about_monads#The_Continuation_monad
>> 
>> 
>> data Cont r a = Cont { runCont :: ((a -> r) -> r)}
>> 
>> instance Monad (Cont r) where
>>   pure x = cont ($ x)
>>   s >>= f = cont $ \c -> runCont s $ \x -> runCont (f x) c
>> 
>> cont :: ((a -> r) -> r) -> Cont r a
>> cont f = Cont { runCont = f}
>> 
>> runCont :: Cont r a -> (a -> r) -> r
>> runCont c = Cont.runCont c
>> 
>> callCC f = cont $ \h -> runCont (f (\a -> cont $ \_ -> h a)) h
>> 
>> fun :: Int -> String
>> fun n = (`runCont` id) $ do
>>str <- callCC $ \exit1 -> do
>>  when (n < 10) (exit1 (show n))
>>  let ns = map digitToInt (unpacked (show (n `div` 2)))
>>  n' <- callCC $ \exit2 -> do
>>when ((length ns) < 3) (exit2 (length ns))
>>when ((length ns) < 5) (exit2 n)
>>when ((length ns) < 7) $ do
>>  let ns` = map intToDigit (reverse ns)
>>  exit1 $ packed $ (dropWhile (== '0') ns')
>>return $ sum ns
>>  return $ "(ns = " ++ (show ns) ++ ") " ++ (show n')
>>return $ "Answer: " ++ str
>> 
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Continuation transformer defined in Frege

2017-11-23 Thread Dierk König
Would be cool to add it to the stdlib. 
Care about a PR? Best add a sample as well. 

Cheers
Dierk

sent from:mobile 

> Am 24.11.2017 um 02:33 schrieb zhou6...@163.com:
> 
> ContT is more pragmatic than Cont,with this powerful abstraction, I could 
> effectively abstract away callbacks and listener in Android. My next 
> exploration is to port coroutineT to Frege
> 
> module examples.MyCont where
> 
> class MonadIO m where
>   --- Lift a computation from the 'IO' monad.
>   liftIO :: IO a -> m a
> 
> class MonadTrans t where
>   --- Lift a computation from the argument monad to the constructed monad.
>   lift :: Monad m => m a -> t m a
> 
> instance MonadIO IO where
>   liftIO io = io
> 
> instance MonadTrans (ContT r) where
> lift m = ContT (m >>=)
> 
> instance (Monad m, MonadIO m) => MonadIO (ContT r m) where
> liftIO = lift . liftIO
> 
> data ContT r m a = ContT { runContT :: (a -> m r) -> m r }
> 
> instance Monad (ContT r m) where
>   pure x = contT ($ x)
>   m >>= k = contT $ \c -> runContT m (\x -> runContT (k x) c)
> 
> contT :: ((a -> m r) -> m r) -> ContT r m a
> contT f = ContT { runContT = f }
> 
> runContT :: ContT r m a -> ((a -> m r) -> m r)
> runContT c = ContT.runContT c
> 
> callCC :: ((a -> ContT r m b) -> ContT r m a) -> ContT r m a
> callCC f = ContT $ \c -> ContT.runContT (f (\a -> ContT $ \_ -> c a)) c
> 
> data Data = native java.util.Date where
>   native new :: () -> IO (MutableIO Data)
>   native toString :: Mutable s Data -> ST s String
> 
> current :: IO String
> current = do
>   d <- Data.new ()
>   d.toString
> 
> fun :: Int -> IO String
> fun = (`runContT` id) $ do
>   callCC $ \exit1 -> do
> exit1 $ liftIO current 
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Continuation transformer defined in Frege

2017-11-24 Thread Dierk König
Ok, that is perfectly fine. 
Then I do the PR on your behalf. 
I’d like to give you due credit, though. Is there a special name or nickname 
that you would like to see in a respective commit?

Dierk

sent from:mobile 

> Am 24.11.2017 um 09:44 schrieb zhou6...@163.com:
> 
> I am just a junior of Haskell, I just copy Michael Chavinda‏'s android 
> project and rewrite existing software. Due to non disclosure agreement, I 
> can't have my own git account. I think google group is the right place I 
> could contribute some code back to Frege. Because my supervisor can not trace 
> my activity on google because of Chinese GFW
> 
> 在 2017年11月24日星期五 UTC+8下午3:01:21,Dierk Koenig写道:
>> 
>> Would be cool to add it to the stdlib. 
>> Care about a PR? Best add a sample as well. 
>> 
>> Cheers
>> Dierk
>> 
>> sent from:mobile 
>> 
>>> Am 24.11.2017 um 02:33 schrieb zhou...@163.com:
>>> 
>>> ContT is more pragmatic than Cont,with this powerful abstraction, I could 
>>> effectively abstract away callbacks and listener in Android. My next 
>>> exploration is to port coroutineT to Frege
>>> 
>>> module examples.MyCont where
>>> 
>>> class MonadIO m where
>>>   --- Lift a computation from the 'IO' monad.
>>>   liftIO :: IO a -> m a
>>> 
>>> class MonadTrans t where
>>>   --- Lift a computation from the argument monad to the constructed monad.
>>>   lift :: Monad m => m a -> t m a
>>> 
>>> instance MonadIO IO where
>>>   liftIO io = io
>>> 
>>> instance MonadTrans (ContT r) where
>>> lift m = ContT (m >>=)
>>> 
>>> instance (Monad m, MonadIO m) => MonadIO (ContT r m) where
>>> liftIO = lift . liftIO
>>> 
>>> data ContT r m a = ContT { runContT :: (a -> m r) -> m r }
>>> 
>>> instance Monad (ContT r m) where
>>>   pure x = contT ($ x)
>>>   m >>= k = contT $ \c -> runContT m (\x -> runContT (k x) c)
>>> 
>>> contT :: ((a -> m r) -> m r) -> ContT r m a
>>> contT f = ContT { runContT = f }
>>> 
>>> runContT :: ContT r m a -> ((a -> m r) -> m r)
>>> runContT c = ContT.runContT c
>>> 
>>> callCC :: ((a -> ContT r m b) -> ContT r m a) -> ContT r m a
>>> callCC f = ContT $ \c -> ContT.runContT (f (\a -> ContT $ \_ -> c a)) c
>>> 
>>> data Data = native java.util.Date where
>>>   native new :: () -> IO (MutableIO Data)
>>>   native toString :: Mutable s Data -> ST s String
>>> 
>>> current :: IO String
>>> current = do
>>>   d <- Data.new ()
>>>   d.toString
>>> 
>>> fun :: Int -> IO String
>>> fun = (`runContT` id) $ do
>>>   callCC $ \exit1 -> do
>>> exit1 $ liftIO current 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Frege Programming Language" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to frege-programming-language+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Continuation transformer defined in Frege

2017-11-24 Thread Dierk König
There are no official rules beyond what is common practice in the open-source 
community.
When a Pull Request is raised, one of the committers validates the quality and 
then merges into master.
When merging, the committer and the "author" can differ. You would be the 
author and visible as such in the repository.
This is to show that you are the cool dude that provided the content :-)


> Am 24.11.2017 um 10:23 schrieb zhou6...@163.com:
> 
> I still prefer my Chinese name Yu Zhou, I come from a none English speaking 
> country. I still have great barrier understanding the culture of Frege group, 
> what's the implied by PR on me as well as giving me due credit?
> 在 2017年11月24日星期五 UTC+8下午5:08:12,Dierk Koenig写道:
> Ok, that is perfectly fine. 
> Then I do the PR on your behalf. 
> I’d like to give you due credit, though. Is there a special name or nickname 
> that you would like to see in a respective commit?
> 
> Dierk
> 
> sent from:mobile 
> 
> Am 24.11.2017 um 09:44 schrieb zhou...@163.com:
> 
>> I am just a junior of Haskell, I just copy Michael Chavinda‏'s android 
>> project and rewrite existing software. Due to non disclosure agreement, I 
>> can't have my own git account. I think google group is the right place I 
>> could contribute some code back to Frege. Because my supervisor can not 
>> trace my activity on google because of Chinese GFW
>> 
>> 在 2017年11月24日星期五 UTC+8下午3:01:21,Dierk Koenig写道:
>> Would be cool to add it to the stdlib. 
>> Care about a PR? Best add a sample as well. 
>> 
>> Cheers
>> Dierk
>> 
>> sent from:mobile 
>> 
>> Am 24.11.2017 um 02:33 schrieb zhou...@163.com:
>> 
>>> ContT is more pragmatic than Cont,with this powerful abstraction, I could 
>>> effectively abstract away callbacks and listener in Android. My next 
>>> exploration is to port coroutineT to Frege
>>> 
>>> module examples.MyCont where
>>> 
>>> class MonadIO m where
>>>   --- Lift a computation from the 'IO' monad.
>>>   liftIO :: IO a -> m a
>>> 
>>> class MonadTrans t where
>>>   --- Lift a computation from the argument monad to the constructed monad.
>>>   lift :: Monad m => m a -> t m a
>>> 
>>> instance MonadIO IO where
>>>   liftIO io = io
>>> 
>>> instance MonadTrans (ContT r) where
>>> lift m = ContT (m >>=)
>>> 
>>> instance (Monad m, MonadIO m) => MonadIO (ContT r m) where
>>> liftIO = lift . liftIO
>>> 
>>> data ContT r m a = ContT { runContT :: (a -> m r) -> m r }
>>> 
>>> instance Monad (ContT r m) where
>>>   pure x = contT ($ x)
>>>   m >>= k = contT $ \c -> runContT m (\x -> runContT (k x) c)
>>> 
>>> contT :: ((a -> m r) -> m r) -> ContT r m a
>>> contT f = ContT { runContT = f }
>>> 
>>> runContT :: ContT r m a -> ((a -> m r) -> m r)
>>> runContT c = ContT.runContT c
>>> 
>>> callCC :: ((a -> ContT r m b) -> ContT r m a) -> ContT r m a
>>> callCC f = ContT $ \c -> ContT.runContT (f (\a -> ContT $ \_ -> c a)) c
>>> 
>>> data Data = native java.util.Date where
>>>   native new :: () -> IO (MutableIO Data)
>>>   native toString :: Mutable s Data -> ST s String
>>> 
>>> current :: IO String
>>> current = do
>>>   d <- Data.new ()
>>>   d.toString
>>> 
>>> fun :: Int -> IO String
>>> fun = (`runContT` id) $ do
>>>   callCC $ \exit1 -> do
>>> exit1 $ liftIO current 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Frege Programming Language" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to frege-programming-language+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Frege Programming Language" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to frege-programming-language+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [frege-programming-language] Continuation transformer defined in Frege

2017-11-27 Thread Dierk König
Hi,

could you post the code that did not compile but should?

Cheers
Dierk

sent from:mobile 

> Am 27.11.2017 um 03:02 schrieb zhou6...@163.com:
> 
> ContT monad transformer sucks , Maybe Frege's type class is not complete 
> compatible with Haskell. The problem is the continuation variable can't be 
> passed out of callCC block. So I decide to implement my continuation 
> mechanism in JNI using scheme's call/cc 
> 
> 在 2017年11月24日星期五 UTC+8下午5:59:22,Dierk Koenig写道:
>> 
>> There are no official rules beyond what is common practice in the 
>> open-source community. 
>> When a Pull Request is raised, one of the committers validates the quality 
>> and then merges into master. 
>> When merging, the committer and the "author" can differ. You would be the 
>> author and visible as such in the repository. 
>> This is to show that you are the cool dude that provided the content :-) 
>> 
>> 
>> > Am 24.11.2017 um 10:23 schrieb zhou...@163.com: 
>> > 
>> > I still prefer my Chinese name Yu Zhou, I come from a none English 
>> > speaking country. I still have great barrier understanding the culture of 
>> > Frege group, what's the implied by PR on me as well as giving me due 
>> > credit? 
>> > 在 2017年11月24日星期五 UTC+8下午5:08:12,Dierk Koenig写道: 
>> > Ok, that is perfectly fine. 
>> > Then I do the PR on your behalf. 
>> > I’d like to give you due credit, though. Is there a special name or 
>> > nickname that you would like to see in a respective commit? 
>> > 
>> > Dierk 
>> > 
>> > sent from:mobile 
>> > 
>> > Am 24.11.2017 um 09:44 schrieb zhou...@163.com: 
>> > 
>> >> I am just a junior of Haskell, I just copy Michael Chavinda‏'s android 
>> >> project and rewrite existing software. Due to non disclosure agreement, I 
>> >> can't have my own git account. I think google group is the right place I 
>> >> could contribute some code back to Frege. Because my supervisor can not 
>> >> trace my activity on google because of Chinese GFW 
>> >> 
>> >> 在 2017年11月24日星期五 UTC+8下午3:01:21,Dierk Koenig写道: 
>> >> Would be cool to add it to the stdlib. 
>> >> Care about a PR? Best add a sample as well. 
>> >> 
>> >> Cheers 
>> >> Dierk 
>> >> 
>> >> sent from:mobile 
>> >> 
>> >> Am 24.11.2017 um 02:33 schrieb zhou...@163.com: 
>> >> 
>> >>> ContT is more pragmatic than Cont,with this powerful abstraction, I 
>> >>> could effectively abstract away callbacks and listener in Android. My 
>> >>> next exploration is to port coroutineT to Frege 
>> >>> 
>> >>> module examples.MyCont where 
>> >>> 
>> >>> class MonadIO m where 
>> >>>   --- Lift a computation from the 'IO' monad. 
>> >>>   liftIO :: IO a -> m a 
>> >>> 
>> >>> class MonadTrans t where 
>> >>>   --- Lift a computation from the argument monad to the constructed 
>> >>> monad. 
>> >>>   lift :: Monad m => m a -> t m a 
>> >>> 
>> >>> instance MonadIO IO where 
>> >>>   liftIO io = io 
>> >>> 
>> >>> instance MonadTrans (ContT r) where 
>> >>> lift m = ContT (m >>=) 
>> >>> 
>> >>> instance (Monad m, MonadIO m) => MonadIO (ContT r m) where 
>> >>> liftIO = lift . liftIO 
>> >>> 
>> >>> data ContT r m a = ContT { runContT :: (a -> m r) -> m r } 
>> >>> 
>> >>> instance Monad (ContT r m) where 
>> >>>   pure x = contT ($ x) 
>> >>>   m >>= k = contT $ \c -> runContT m (\x -> runContT (k x) c) 
>> >>> 
>> >>> contT :: ((a -> m r) -> m r) -> ContT r m a 
>> >>> contT f = ContT { runContT = f } 
>> >>> 
>> >>> runContT :: ContT r m a -> ((a -> m r) -> m r) 
>> >>> runContT c = ContT.runContT c 
>> >>> 
>> >>> callCC :: ((a -> ContT r m b) -> ContT r m a) -> ContT r m a 
>> >>> callCC f = ContT $ \c -> ContT.runContT (f (\a -> ContT $ \_ -> c a)) c 
>> >>> 
>> >>> data Data = native java.util.Date where 
>> >>>   native new :: () -> IO (MutableIO Data) 
>> >>>   native toString :: Mutable s Data -> ST s String 
>> >>> 
>> >>> current :: IO String 
>> >>> current = do 
>> >>>   d <- Data.new () 
>> >>>   d.toString 
>> >>> 
>> >>> fun :: Int -> IO String 
>> >>> fun = (`runContT` id) $ do 
>> >>>   callCC $ \exit1 -> do 
>> >>> exit1 $ liftIO current 
>> >>> 
>> >>> 
>> >>> 
>> >>> 
>> >>> 
>> >>> 
>> >>> -- 
>> >>> You received this message because you are subscribed to the Google 
>> >>> Groups "Frege Programming Language" group. 
>> >>> To unsubscribe from this group and stop receiving emails from it, send 
>> >>> an email to frege-programming-language+unsubscr...@googlegroups.com. 
>> >>> For more options, visit https://groups.google.com/d/optout. 
>> >> 
>> >> -- 
>> >> You received this message because you are subscribed to the Google Groups 
>> >> "Frege Programming Language" group. 
>> >> To unsubscribe from this group and stop receiving emails from it, send an 
>> >> email to frege-programming-language+unsubscr...@googlegroups.com. 
>> >> For more options, visit https://groups.google.com/d/optout. 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google Groups 
>> > "Frege Programming Language" group. 
>> > To unsubscribe from thi

Re: [frege-programming-language] STM on Android

2018-01-08 Thread Dierk König
Ok, thanks a lot!
I have to look more closely into this, esp wrt contention 
and effect on performance. 

Cool to see Frege STM on Android!

all the best
Dierk

sent from:mobile 

> Am 08.01.2018 um 10:26 schrieb zhou6...@163.com:
> 
> I've tryed SillyClock on android and works but when I proceed to more complex 
> transaction involving both writeTVar and orElse, the App crashed because 
> putIfAbsent was not implemented, so I replace java.util.Map to 
> java.util.ConcurrentHashMap and it works again
> 
> 
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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