Talk:TypeCompose
From HaskellWiki
(Reply to Wolfgang -- App) |
(addition of answer concerning App/Apply) |
||
| (2 intermediate revisions not shown.) | |||
| Line 39: | Line 39: | ||
-- [[User:Conal|Conal]] 20:18, 4 December 2007 (UTC) | -- [[User:Conal|Conal]] 20:18, 4 December 2007 (UTC) | ||
| + | |||
| + | ---- | ||
| + | |||
| + | Sorry, I hadn't looked that deeply into TypeCompose to discover App. Yes, this is what I meant. | ||
| + | |||
| + | <hask>(:$)</hask> might be nice as its type constructor name (but not as its data constructor name since the data constructor is unary). But if we use <hask>(:$)</hask> instead of <hask>App</hask>, we should also use <hask>(:.)</hask> instead of <hask>O</hask>. In grapefruit-data, I had a module <hask>Data.Composition</hask> which used <hask>(:.:)</hask>. Actually, I don't like the <hask>O</hask>. While it looks similar to the function composition operator, it isn't the function composition operator. Instead, it is just a letter, and identifiers made of letters should be descriptive, in my opinion, like <hask>App</hask>, for example. | ||
| + | |||
| + | I haven't played with <hask>(:*:)</hask> and its counterpart yet. No time. :-( | ||
| + | |||
| + | : Understood. I think you'll like it. [[User:Conal|Conal]] 17:15, 5 December 2007 (UTC) | ||
| + | |||
| + | Grapefruit now dropped the modules <hask>Data.Monoid.Bonus</hask> and <hask>Data.Composition</hask> and uses TypeCompose 0.2 instead. | ||
| + | |||
| + | By the way, I don't like that in this wiki one isn't able to indent answers to previous comments if the answer contains multiple lines of Haskell code. Normally, one should (and should be able to) indent answers by preceding one's paragraphs with single colons. This doesn't really work with haskell tags. It's not composable. ;-) | ||
| + | |||
| + | -- [[User:Wolfgang Jeltsch|Wolfgang Jeltsch]] 16:57, 5 December 2007 (UTC) | ||
| + | |||
| + | ---- | ||
| + | |||
| + | Thanks for catching my <hask>f :$ a</hask> mistake. Do you have a preference about data constructor name, e.g., <hask>App</hask> or <hask>Apply</hask>? | ||
| + | |||
| + | I like <hask>(:.)</hask> or <hask>(:.:)</hask> as a replacement for <hask>O</hask>. Hm. I don't remember why I chose <hask>(:*:)</hask> instead of <hask>(:*)</hask>. | ||
| + | |||
| + | Btw, I mean to remove <hask>Id</hask> in favor of the <hask>Id</hask> in Data.Traversable. | ||
| + | |||
| + | -- [[User:Conal|Conal]] 17:15, 5 December 2007 (UTC) | ||
| + | |||
| + | ---- | ||
| + | |||
| + | No preference concerning <hask>App</hask> and <hask>Apply</hask> from my side at the moment. | ||
| + | |||
| + | -- [[User:Wolfgang Jeltsch|Wolfgang Jeltsch]] 23:13, 5 December 2007 (UTC) | ||
Current revision
Hello Conal,
I have a typeWhat do you think?
-- Wolfgang Jeltsch 18:23, 4 December 2007 (UTC)
I like it. It's the same as
newtype App f a = App { unApp :: f a } instance (Applicative f, Monoid m) => Monoid (App f m) where mempty = App (pure mempty ) App a `mappend` App b = App (liftA2 mappend a b)
instance (Applicative f, Monoid m) => Monoid (App f m) where mempty = App (pure mempty ) mappend = inApp2 (liftA2 mappend)
data f :$ a = f :$ a
I guess I'd like two infix ops -- one left-associative and one right-associative.
By the way, have you played with-- Conal 20:18, 4 December 2007 (UTC)
Sorry, I hadn't looked that deeply into TypeCompose to discover App. Yes, this is what I meant.
- Understood. I think you'll like it. Conal 17:15, 5 December 2007 (UTC)
By the way, I don't like that in this wiki one isn't able to indent answers to previous comments if the answer contains multiple lines of Haskell code. Normally, one should (and should be able to) indent answers by preceding one's paragraphs with single colons. This doesn't really work with haskell tags. It's not composable. ;-)
-- Wolfgang Jeltsch 16:57, 5 December 2007 (UTC)
Thanks for catching my
-- Conal 17:15, 5 December 2007 (UTC)
No preference concerning
-- Wolfgang Jeltsch 23:13, 5 December 2007 (UTC)
