Aug. 15th, 2013

yorool_gui: (лысый)
http://happstack.com/docs/crashcourse/AcidState.html
"Syntax is not as nice" - это некоторое преуменьшение, вам так не кажется?
"Вот поэтому я и не женюсь" (с) О чем говорят мужчины. В смысле, вот поэтому хаскель и не используют

Here we update the nickName for UserId 0:


> changeNick :: UserState
> changeNick =
>   (users ^%= user (UserId 0) ^%= fmap (name ^%= (nickName ^= "stepkut"))) userState

In a traditional imperative language we write changeNick something like:

changeNick() { userState.users[0].name.nickName = "stepkut"; }

Looking at the two, you can see the similarity, even if the syntax is not as nice.

Profile

yorool_gui: (Default)
Michael Ilyin

April 2017

S M T W T F S
      1
2 345678
910 1112131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 24th, 2025 05:35 pm
Powered by Dreamwidth Studios