Skip to content

Instantly share code, notes, and snippets.

@ikedaisuke
Last active December 15, 2015 22:09
Show Gist options
  • Save ikedaisuke/5330979 to your computer and use it in GitHub Desktop.
Save ikedaisuke/5330979 to your computer and use it in GitHub Desktop.
half-finished translation of tune's slides "Lens で Haskell をもっと格好良く!" it's just only half of each header of slide yet. here is the original source: http://www.slideshare.net/itsoutoftunethismymusic/ekmett-17955009

Title

A gentle introduction to write an attractive Haskell program with lens

Author

ちゅーん tune

Date

2013-03-31

Note

"ekmett" 勉強会 (ben-kyo-kai; meeting) at Shibuya, Tokyo Japan.

#ekmett_conf is the hash tag of twitter.

Almost Japanese tweets are gathering here.

The meeting went off very well.

Translator

IKEGAMI Daisuke [email protected]

ikeg at #haskell-lens at IRC freenode.

Please send me your comments.

Who is the author?

undefined

Contents

undefined

What is lens

undefined

Introduction : useful tuples with lens

undefined

How to get a member in a tuple

undefined

Case of a nested tuples

undefined

Replace a member in a tuple

undefined

What is a problem with replacing

undefined

Complaints without lens

undefined

With lens!

undefined

Getting started with lens

undefined

Import lens

undefined

How to get a member in a tuple

undefined

How to replace a member in a tuple

undefined

Conclusion of this section

undefined

Any datatype with lens

undefined

Example : Point and Line

undefined

To manipulate Point without lens is simple

undefined

To replace Point is complex

undefined

With lens!

undefined

Continued : Point and Line with lens

undefined

Operators in lens

undefined

Conclusion of this section

undefined

Look inside lens

undefined

Define "Setter"

undefined

Look fmapDefault

undefined

And traverse

undefined

One, two, setters

undefined

Define setters

undefined

And more

undefined

Next, getters

undefined

Peep foldMapDefault

undefined

Abstract traverse

undefined

Define accessors

undefined

Apply _1 and _2 to foldMapOf

undefined

Define the operator (^.)

undefined

Getter and Setter

undefined

Final : definition of Lens via Functor

undefined

Reimplement _1 and _2 with Lens

undefined

Compose traverses

undefined

Compose _1 and itself

undefined

Conclusion this section

undefined

Remark

undefined

Advice on looking into Lens

undefined

Introduction to functions of lens

undefined

Read documents in Hackage

undefined

Example : foldMapOf and over

undefined

Example : to

undefined

Examples: Setter and operators

undefined

Examples : (.=) and use

undefined

Examples : Setter and MonadState

undefined

Example : Action

undefined

Others in Hackage

undefined

Bottom of lens

undefined

What is lens

undefined

Message from the author

undefined

Message from an audience

undefined

UNDEFINED MANY THINGS YET

With lens!

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment