Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Non ghc specific FRP (using uhc js backend)
      (Heinrich Apfelmus)
   2. Re:  Beginners Digest, Vol 45, Issue 35 (Chadda? Fouch?)
   3. Re:  Beginners Digest, Vol 45, Issue 35 (Chadda? Fouch?)
   4. Re:  Non ghc specific FRP (using uhc js backend) (Nathan H?sken)


----------------------------------------------------------------------

Message: 1
Date: Thu, 29 Mar 2012 10:05:31 +0200
From: Heinrich Apfelmus <apfel...@quantentunnel.de>
Subject: Re: [Haskell-beginners] Non ghc specific FRP (using uhc js
        backend)
To: beginners@haskell.org
Message-ID: <jl154c$4nj$1...@dough.gmane.org>
Content-Type: text/plain; charset=UTF-8; format=flowed

Nathan H?sken wrote:
> 
> I am currently informing myself about FRP. Looking at the Elerea paper 
> (http://sgate.emt.bme.hu/documents/patai/publications/PataiWFLP2010.pdf) 
> I read that it is ghc specific because of mutable references.
> I am trying to use the js backend of uhc and that does not support this.
> I have tried to use other FRP libraries with uhc (by compiling a file 
> which does nothing but import the library) and all failed because of 
> something missing in Control.Concurrent.
> 
> So I am wondering: Is it a property FRP that it needs something like 
> mutable references for an efficient implementation.
> Is there a FRP library that can be used (or can be changed so that it 
> can be used) with uhc and its js backend?

I think that my reactive-banana library can be adapted to work on UHC. I 
will look into this. See issue

   https://github.com/HeinrichApfelmus/reactive-banana/issues/30


However, I would be very surprised if UHC doesn't have mutable 
variables, the reason is likely a GHC specific extension. Are you sure 
that UHC doesn't support IORef or MVar?


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com




------------------------------

Message: 2
Date: Thu, 29 Mar 2012 10:28:47 +0200
From: Chadda? Fouch? <chaddai.fou...@gmail.com>
Subject: Re: [Haskell-beginners] Beginners Digest, Vol 45, Issue 35
To: Lorenzo Bolla <lbo...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <canfjzrbwahxe5zfqmv6elmogrfhct-deofyg2dqykwrkblu...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

The evident solution is :

> unique xs = [x | x <- xs, isIn x xs 2]
>
> isIn _ _ 0 = True
> isIn _ [] _ = False
> isIn y (x:xs) n
>       | y == x    = isIn y xs (n-1)
>       | otherwise = isIn y xs n

which is quite obviously O(n^2)... (same idea but just a bit faster
than Lorenzo one-liner)
The solution proposed here is slightly better : for each element,
either he is unique and then it is useless to compare the following
elements to it, either he isn't and so none of his subsequent
occurrences may be unique, we may proceed with the tail of the list
without these occurrences. Note that the second solution of franco00
is wrong because it doesn't remove the subsequent occurrences. Still
it is O(n^2) as a sum(k from k=n to k=1).

Still, we can get better : O(n log n) with a solution based on a sort
or Data.Map :

> unique xs = nub (sort xs)

-- 
Jeda?



------------------------------

Message: 3
Date: Thu, 29 Mar 2012 10:30:55 +0200
From: Chadda? Fouch? <chaddai.fou...@gmail.com>
Subject: Re: [Haskell-beginners] Beginners Digest, Vol 45, Issue 35
To: Lorenzo Bolla <lbo...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <canfjzrbmmgrc5sqjshaceapyizqvcftutjuzium0dqzopas...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Thu, Mar 29, 2012 at 10:28 AM, Chadda? Fouch?
<chaddai.fou...@gmail.com> wrote:
>> unique xs = nub (sort xs)

oops, I meant :

> unique = concat . filter (null . drop 1) . group . sort

-- 
Jeda?



------------------------------

Message: 4
Date: Thu, 29 Mar 2012 10:49:11 +0200
From: Nathan H?sken <nathan.hues...@posteo.de>
Subject: Re: [Haskell-beginners] Non ghc specific FRP (using uhc js
        backend)
To: beginners@haskell.org
Message-ID: <4f742207.1030...@posteo.de>
Content-Type: text/plain; charset=UTF-8

Hey,

Ah, very nice to see that there is interest in making a UHC compatible
version.
I tried the following: I made file Test.hs with only

import Reactive.Banana

in it. ghc compiles fine except telling me that main is missing.
"uhc -tjs" complains about missing Data/Hashable and Control/Concurrent.
That's all I know.

Best regards,
Nathan

On 03/29/2012 10:05 AM, Heinrich Apfelmus wrote:
> Nathan H?sken wrote:
>>
>> I am currently informing myself about FRP. Looking at the Elerea paper
>> (http://sgate.emt.bme.hu/documents/patai/publications/PataiWFLP2010.pdf)
>> I read that it is ghc specific because of mutable references.
>> I am trying to use the js backend of uhc and that does not support this.
>> I have tried to use other FRP libraries with uhc (by compiling a file
>> which does nothing but import the library) and all failed because of
>> something missing in Control.Concurrent.
>>
>> So I am wondering: Is it a property FRP that it needs something like
>> mutable references for an efficient implementation.
>> Is there a FRP library that can be used (or can be changed so that it
>> can be used) with uhc and its js backend?
> 
> I think that my reactive-banana library can be adapted to work on UHC. I
> will look into this. See issue
> 
>   https://github.com/HeinrichApfelmus/reactive-banana/issues/30
> 
> 
> However, I would be very surprised if UHC doesn't have mutable
> variables, the reason is likely a GHC specific extension. Are you sure
> that UHC doesn't support IORef or MVar?
> 
> 
> Best regards,
> Heinrich Apfelmus
> 
> -- 
> http://apfelmus.nfshost.com
> 
> 
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners




------------------------------

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 45, Issue 38
*****************************************

Reply via email to