Re: [Haskell-cafe] How to fold on types?

2012-12-25 Thread Тимур Амиров
Try folding over data type constructor with $?

вторник, 25 декабря 2012 г. пользователь Magicloud Magiclouds писал:

 Forgot to mention, solution without TemplateHaskell.


 On Tue, Dec 25, 2012 at 4:59 PM, Magicloud Magiclouds 
 magicloud.magiclo...@gmail.com javascript:_e({}, 'cvml',
 'magicloud.magiclo...@gmail.com'); wrote:

 Say I have things like:

 data LongDec = LongDef a b c ... x y z
 values = [ 'a', 'b', 'c', ... 'x', 'y', 'z' ]

 Now I want them to be LongDef 'a' 'b' 'c' ... 'x' 'y' 'z'.
 In form, this is something like folding. But since the type changes, so
 code like following won't work:

 foldl (\def value - def value) LongDef values

 Is it possible to do this in some way?
 --
 竹密岂妨流水过
 山高哪阻野云飞

 And for G+, please use magiclouds#gmail.com.




 --
 竹密岂妨流水过
 山高哪阻野云飞

 And for G+, please use magiclouds#gmail.com.



-- 
Best
Timur DeTeam Amirov
Moscow, Russia
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How to fold on types?

2012-12-25 Thread Тимур Амиров
Thinking from subway (: foldl ($) LongDef values ?

вторник, 25 декабря 2012 г. пользователь Тимур Амиров писал:

 Try folding over data type constructor with $?

 вторник, 25 декабря 2012 г. пользователь Magicloud Magiclouds писал:

 Forgot to mention, solution without TemplateHaskell.


 On Tue, Dec 25, 2012 at 4:59 PM, Magicloud Magiclouds 
 magicloud.magiclo...@gmail.com wrote:

 Say I have things like:

 data LongDec = LongDef a b c ... x y z
 values = [ 'a', 'b', 'c', ... 'x', 'y', 'z' ]

 Now I want them to be LongDef 'a' 'b' 'c' ... 'x' 'y' 'z'.
 In form, this is something like folding. But since the type changes, so
 code like following won't work:

 foldl (\def value - def value) LongDef values

 Is it possible to do this in some way?
 --
 竹密岂妨流水过
 山高哪阻野云飞

 And for G+, please use magiclouds#gmail.com.




 --
 竹密岂妨流水过
 山高哪阻野云飞

 And for G+, please use magiclouds#gmail.com.



 --
 Best
 Timur DeTeam Amirov
 Moscow, Russia



-- 
Best
Timur DeTeam Amirov
Moscow, Russia
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Moscow Haskell Users Group (MskHUG) December meeting.

2012-12-03 Thread Тимур Амиров
I'm in!
Would like to talk with people, writing some web-based production apps!

2012/12/3 Serguey Zefirov sergu...@gmail.com

 I would like to announce MskHUG December meeting and invite everyone
 interested.

 The meeting will take place December 13th, 20:00 to 23:30 in the nice
 conference center in centre of Moscow: http://www.nf-conference.ru/

 The meeting's agenda is to start more intense discussions. Most
 probably, there will be a couple of short presentations - I can tell
 about creating fast Haskell programs to handle large data to start the
 discussion.

 I will bring white paper and pencils for everyone to write and draw,
 there will be projector and screen and also tea, cofee and snacks.

 If you want to participate, please, email me.

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




-- 
Best
Timur DeTeam Amirov
Moscow, Russia
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Observer pattern in haskell FRP

2012-11-26 Thread Тимур Амиров
Not sure, but maybe you can define a Drawable  class with a method in
converting inner state to something draw func could use, so it would be
like this:

draw :: Drawable a = a - IO ()

вторник, 27 ноября 2012 г. пользователь Nathan Hüsken писал:

 Hey,

 When writing games in other (imperative) languages, I like to separate
 the game logic from the rendering. For this I use something similar to
 the observer pattern.

 With rendering I mean anything only related to how objects are drawn to
 the screen. Animation state for example.

 On my journey of exploring game programming with haskell (and FRP), I
 wonder what a good way of archiving something similar would be.

 If the rendering has no internal state, one can just write a function

 draw :: GameLogicState - IO ()

 But when the rendering of an object has an internal state (e.g.
 animation frame) than this is not possible.

 Now I could write a Wire/Signal (whatever FRP implementation I use) that
 translates to a RenderingState:

 render :: Signal GameLogicState RenderingState
 draw :: RenderingState - IO ()

 which is fine, except when my game is made of many objects.
 Than I need to associate the state of one object in GameLogicState with
 a sub-signal in render.
 That could be done by giving every object an ID and letting
 GameLogicState contain a map from IDs to ObjectLogicState.

 I fear that when I really have a lot of objects, assembling and
 decomposing the map could become a major bottleneck.

 So I am wondering: Is there (or can someone think of) a different
 pattern by which this could be archived? Or asked different: How would
 you do it?

 Thanks!
 Nathan

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org javascript:;
 http://www.haskell.org/mailman/listinfo/haskell-cafe



-- 
Best
Timur DeTeam Amirov
Moscow, Russia
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Survey: What are the more common Haskell IDEs in use ?

2012-11-24 Thread Тимур Амиров
SublimeText is fine

2012/11/24 David Virebayre dav.vire+hask...@gmail.com

 I often use geany too

 2012/11/24 Erik de Castro Lopo mle...@mega-nerd.com:
  Dan wrote:
 
  Because I see there are many preferences on what IDE to use for Haskell
  I've created a quick survey on this topic.
 
  Please click here and select your choices from the lists.
 
  http://kwiksurveys.com/s.asp?sid=oqr42h4jc8h0nbc53652
 
 
  Any comments/suggestions are welcome.
 
  I use Geany which is not on the list.
 
  Erik
  --
  --
  Erik de Castro Lopo
  http://www.mega-nerd.com/
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




-- 
Best
Timur DeTeam Amirov
Moscow, Russia
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe