Awesome, I clearly am off on my understanding. How could I do this: "foldl (+) 0 estimates <+> (Just . fromIntegral) (length estimates)" without the parenthesis? Thanks, Wes
The actual code I have working is: let estimates = [5,5,8,8,2,1,5,2] (/) <$> (Just $ foldl (+) 0 estimates) <*> ((Just . fromIntegral) (length estimates)) What I want to do is get rid of all the parentheses except (/) Is it possible? Thanks, wes From: Beginners <beginners-bounces@haskell.org<mailto:beginners-bounces@haskell.org>> on behalf of "Williams, Wes(AWF)" <wewilliams@paypal.com<mailto:wewilliams@paypal.com>> Reply-To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org<mailto:beginners@haskell.org>> Date: Friday, August 28, 2015 at 11:31 AM To: "beginners@haskell.org<mailto:beginners@haskell.org>" <beginners@haskell.org<mailto:beginners@haskell.org>> Subject: [Haskell-beginners] applicative style Awesome, I clearly am off on my understanding. How could I do this: "foldl (+) 0 estimates <+> (Just . fromIntegral) (length estimates)" without the parenthesis? Thanks, Wes
On Fri, Aug 28, 2015 at 2:51 PM, Williams, Wes(AWF) <wewilliams@paypal.com> wrote:
What I want to do is get rid of all the parentheses except (/) Is it possible?
Not without breaking it up into chunks like you did in ghci (probably using a let or where). -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
Thanks for the feedback and guidance Brandon! From: Beginners <beginners-bounces@haskell.org<mailto:beginners-bounces@haskell.org>> on behalf of Brandon Allbery <allbery.b@gmail.com<mailto:allbery.b@gmail.com>> Reply-To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org<mailto:beginners@haskell.org>> Date: Friday, August 28, 2015 at 12:01 PM To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org<mailto:beginners@haskell.org>> Subject: Re: [Haskell-beginners] applicative style On Fri, Aug 28, 2015 at 2:51 PM, Williams, Wes(AWF) <wewilliams@paypal.com<mailto:wewilliams@paypal.com>> wrote: What I want to do is get rid of all the parentheses except (/) Is it possible? Not without breaking it up into chunks like you did in ghci (probably using a let or where). -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com<mailto:allbery.b@gmail.com> ballbery@sinenomine.net<mailto:ballbery@sinenomine.net> unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (2)
-
Brandon Allbery -
Williams, Wes(AWF)