neongreen / artyom.me Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://artyom.me
Home Page: https://artyom.me
make cv
, make all
, etc
You have
iterated :: Fold1 a a
iterated f g a = go a
where go a = g a .> go (f a)
but I think it should be
iterated :: (a -> a) -> Fold1 a a
iterated f g a = go a
where go a = g a .> go (f a)
The signatures in the open question below agree with this.
All the best,
Richard
Currently it reads:
.:?
is just like.:
, but doesn't fail if the field wasn't found (it does fail if the field was found but has a different type, however).
That description actually matches the .:!
operator, not .:?
.
.:!
doesn't fail if the field wasn't found.
.:?
doesn't fail if the field wasn't found or if its value is Null
.
See the docs for .:?
.
This shouldn't usually come up, it can't hurt to be precise. I'm really enjoying the tutorial so far btw!
<|>
and sum types better@manpages is the first offender!
The link in lens-over-tea-1.md
[`second`][] is a function from `Data.Bifunctor`
points to non-existing http://hackage.haskell.org/package/bifunctors-5.5/docs/Data-Bifunctor.html#v:second
Consider to replace it statically by
https://hackage.haskell.org/package/bifunctors-5/docs/Data-Bifunctor.html#v:second
02:08 <magbo> (<%~) l h y = l (\x -> (h x, h x)) y
02:08 <magbo> Works on every lens.
02:08 <magbo> Returns (b, t) -- updated focused value and updated source
02:09 <puregreen> magbo: do you know how the Functor instance for (,) works?
02:09 <magbo> (,) is the outer functor, that was my intention when I was writing it
02:10 <magbo> puregreen: oh snap, it answers my question!
02:10 <jle`> it's Writer! :O
02:11 <jle`> magbo: `(\x -> tell (h x) >> return (h x))` would get you
the Writer translation of what you wrote
02:11 <puregreen> jle`: ooh, I like this one
02:12 <puregreen> gotta steal it for lens over tea
02:12 <jle`> it's technically wrong because it requires a Monoid instance i think
02:16 <jle`> puregreen: oh, you can get a working version of what i wrote
with tell (h x) $> h x, because while it's equivalent to
tell (h x) *> return (h x), it doesn't require a Monoid constraint
Hello,
First of all, thanks for the great series :)
I'm trying to understand the note about enum
in lens over tea 4. Specifically, this part:
Now let's consider 2 cases – the first is when we use it to turn
s
intoa
, the second is when we use the iso to turnb
intot
. The definition we already have works well enough for the former case, but in the latter case s doesn't even exist:
enum f = \_ -> fromEnum <$> f ???
I don't understand what you mean by saying "turn the b
into the t
".
From what I understand,
enum :: Lens' Int a
enum :: Lens Int Int a a ~= Lens s t a b
b -> t :: a -> Int
why is this not a valid candidate?
enum_rev :: Lens' a Int
enum_rev f a = toEnum <$> f (fromEnum a)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.