MarcelineVQ 2017-03-09 05:18:24
not quite, that's not <$> f
tfc 2017-03-09 05:18:42
ok, i see...
MarcelineVQ 2017-03-09 05:18:44
you want the composition to happen still
c_wraith 2017-03-09 05:18:47
fmap not . f
tfc 2017-03-09 05:18:47
yes
tfc 2017-03-09 05:19:13
wow that works, thank you!
kubunto 2017-03-09 05:20:43
is char a legal variable name?
kubunto 2017-03-09 05:21:04
nvm
tfc 2017-03-09 05:23:27
MarcelineVQ: ok, i have working what i need. but i do not understand the syntax of "fmap not . testMachine". i do not find a pair of braces i can put there to understand how this works.
tfc 2017-03-09 05:25:58
MarcelineVQ: if :t fmap is Functor f => (a -> b) -> f a -> f b, then i do not see how the "not . f" fits in. while "not" alone can be the first parameter alone , which makes it all a f a -> f b function, i don't understand the next composition step. can you help me here?
Tuplanolla 2017-03-09 05:26:25
Expand the definition of `.`, tfc.
MarcelineVQ 2017-03-09 05:26:28
the definition for (.) is f . g = \x -> f (g x) so to plug in the values for your case it's something like \x -> fmap not (f x)
tfc 2017-03-09 05:27:30
oh, i see. the lambda version is more comprehensive to me. thank you.
SexHendrix 2017-03-09 05:28:15
@src (.)
lambdabot 2017-03-09 05:28:21
(f . g) x = f (g x)
tfc 2017-03-09 05:28:22
i know the definition of ".'
tfc 2017-03-09 05:28:30
the problem is that i know what fmap does, and i know what "a . b" does, but while "not . (f :: a -> IO Bool)" does not work, and "fmap not f" also does not work, it's kind of complicated why "fmap not . f" works.
MarcelineVQ 2017-03-09 05:29:39
did the above clear that up for you now?
shapr 2017-03-09 05:33:12
kubunto: [x | xs <- ["foo","bar"], x <- xs] ?
tfc 2017-03-09 05:33:12
aaah now i get it. (fmap not) . testMachine
tfc 2017-03-09 05:33:17
:)
tfc 2017-03-09 05:33:23
thank yo very much MarcelineVQ!
MarcelineVQ 2017-03-09 05:34:02
np, I should have been more clear
kubunto 2017-03-09 05:34:16
shapr: i want to be able to loop thru a list of punctuation marks and use them as arguments to a function i wrote
tfc 2017-03-09 05:34:37
i am still quickly confused by missing parentheses
shapr 2017-03-09 05:34:59
kubunto: do you want to pass each mark to different functions? or what?
c_wraith 2017-03-09 05:35:05
tfc, function calls always bind more tightly than operators
kubunto 2017-03-09 05:35:32
shapr: one sec
c_wraith 2017-03-09 05:35:37
I suppose I should say "function application"
tfc 2017-03-09 05:35:41
c_wraith: yes, while i know this, i am used yet to always read it like that. hling keeps kicking me for adding too many parentheses
SexHendrix 2017-03-09 05:37:14
kubunto: functionYouMade <$> listOfPunctuation
shapr 2017-03-09 05:37:34
yeah, fmap is the easy way
kubunto 2017-03-09 05:37:56
SexHendrix: i have better idea