2 added 67 characters in body
source | link

Fixity declarations are your friends

As we know often it is often cheaper to define an operator instead of a function (see this tip), sometimes it pays off to declare a fixity different from the default (infixl 9). Imagine for example the following which is fairly common (57 bytes):

(a:b)!(c:d)=undefined
(a:b)!e=undefined
e!(a:b)=undefined

In that particular case using a fixity declaration is still 1 byte more expensive (58 bytes):

infix 4!
a:b!c:d=undefined
a:b!e=undefined
e!a:b=undefined

As you can see you can use the low fixity to omit several parentheses, if somewhere in your code you have other parentheses that are due to the high default fixity, you can save bytes for these by declaring another fixity.


Note: This might seem like an arbitrary example but it is realistic as you can see in this answer.

Fixity declarations are your friends

As we know often it is cheaper to define an operator instead of a function, sometimes it pays off to declare a fixity different from the default (infixl 9). Imagine for example the following which is fairly common (57 bytes):

(a:b)!(c:d)=undefined
(a:b)!e=undefined
e!(a:b)=undefined

In that particular case using a fixity declaration is still 1 byte more expensive (58 bytes):

infix 4!
a:b!c:d=undefined
a:b!e=undefined
e!a:b=undefined

As you can see you can use the low fixity to omit several parentheses, if somewhere in your code you have other parentheses that are due to the high default fixity, you can save bytes for these by declaring another fixity.


Note: This might seem like an arbitrary example but it is realistic as you can see in this answer.

Fixity declarations are your friends

As we know it is often cheaper to define an operator instead of a function (see this tip), sometimes it pays off to declare a fixity different from the default (infixl 9). Imagine for example the following which is fairly common (57 bytes):

(a:b)!(c:d)=undefined
(a:b)!e=undefined
e!(a:b)=undefined

In that particular case using a fixity declaration is still 1 byte more expensive (58 bytes):

infix 4!
a:b!c:d=undefined
a:b!e=undefined
e!a:b=undefined

As you can see you can use the low fixity to omit several parentheses, if somewhere in your code you have other parentheses that are due to the high default fixity, you can save bytes for these by declaring another fixity.


Note: This might seem like an arbitrary example but it is realistic as you can see in this answer.

1
source | link

Fixity declarations are your friends

As we know often it is cheaper to define an operator instead of a function, sometimes it pays off to declare a fixity different from the default (infixl 9). Imagine for example the following which is fairly common (57 bytes):

(a:b)!(c:d)=undefined
(a:b)!e=undefined
e!(a:b)=undefined

In that particular case using a fixity declaration is still 1 byte more expensive (58 bytes):

infix 4!
a:b!c:d=undefined
a:b!e=undefined
e!a:b=undefined

As you can see you can use the low fixity to omit several parentheses, if somewhere in your code you have other parentheses that are due to the high default fixity, you can save bytes for these by declaring another fixity.


Note: This might seem like an arbitrary example but it is realistic as you can see in this answer.