<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sorbot/src, branch tmp</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/'/>
<entry>
<title>tmp; fix/reword</title>
<updated>2017-09-06T21:27:45+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-06T21:27:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=712dca5f860529c33ad19e7babf5c471181e2573'/>
<id>712dca5f860529c33ad19e7babf5c471181e2573</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>privmsgFromPlugin: Rewrite using MaybeT monad transformer</title>
<updated>2017-08-26T22:40:55+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-26T22:40:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=8e5b862c9171af8af7c6c0d0456ae67a9e737633'/>
<id>8e5b862c9171af8af7c6c0d0456ae67a9e737633</id>
<content type='text'>
OMG it works!!! This took me a week of off-and-on tinkering, learning,
procrastinating, and struggling. So awesome that it's finally working!

The `liftMaybe` was key, learned that from:
https://stackoverflow.com/questions/8684252/how-to-inject-a-maybe-value-into-maybet

This article on monad transformers by 'kqr' also helped quite a bit:
https://github.com/kqr/gists/blob/master/articles/gentle-introduction-monad-transformers.md

A Wikibooks article on the same was somewhat useful:
https://en.wikibooks.org/wiki/Haskell/Monad_transformers

And this was an interesting look at Alternatives, which I didn't end up
using but was interesting nonetheless:
http://www.parsonsmatt.org/2016/11/18/clean_alternatives_with_maybet.html

When I learned about monad transformers I thought: "Yes! This is what I
need to clean up the `privmsgFromPlugin` function.". I wasn't liking the
nested `case` statements there, and since everything was a `Maybe`, I
thought, why can't we chain the `Maybe`s like we're supposed to be able
to with monads? Well, turns out we can. It just involved a lot of tricky
`lift`ing. This gets rid of the nesting, resulting in a much cleaner-
looking function. So cool!
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OMG it works!!! This took me a week of off-and-on tinkering, learning,
procrastinating, and struggling. So awesome that it's finally working!

The `liftMaybe` was key, learned that from:
https://stackoverflow.com/questions/8684252/how-to-inject-a-maybe-value-into-maybet

This article on monad transformers by 'kqr' also helped quite a bit:
https://github.com/kqr/gists/blob/master/articles/gentle-introduction-monad-transformers.md

A Wikibooks article on the same was somewhat useful:
https://en.wikibooks.org/wiki/Haskell/Monad_transformers

And this was an interesting look at Alternatives, which I didn't end up
using but was interesting nonetheless:
http://www.parsonsmatt.org/2016/11/18/clean_alternatives_with_maybet.html

When I learned about monad transformers I thought: "Yes! This is what I
need to clean up the `privmsgFromPlugin` function.". I wasn't liking the
nested `case` statements there, and since everything was a `Maybe`, I
thought, why can't we chain the `Maybe`s like we're supposed to be able
to with monads? Well, turns out we can. It just involved a lot of tricky
`lift`ing. This gets rid of the nesting, resulting in a much cleaner-
looking function. So cool!
</pre>
</div>
</content>
</entry>
<entry>
<title>Use explicit imports when importing plugins</title>
<updated>2017-08-20T19:26:47+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T19:26:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=46f05f8e4d87b2f9e09959bdfc0c890278568db2'/>
<id>46f05f8e4d87b2f9e09959bdfc0c890278568db2</id>
<content type='text'>
Going for readability in explicitness.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Going for readability in explicitness.
</pre>
</div>
</content>
</entry>
<entry>
<title>GitHubCommit: Remove the `Id` type</title>
<updated>2017-08-20T18:42:28+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T18:42:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=9e543e593ffe7468789b159f8f5ccf2eb57cb53a'/>
<id>9e543e593ffe7468789b159f8f5ccf2eb57cb53a</id>
<content type='text'>
We're not using this any more so it can be removed. I had added when I
was originally experimenting with getting values from the database and
had been selecting the `id` field.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We're not using this any more so it can be removed. I had added when I
was originally experimenting with getting values from the database and
had been selecting the `id` field.
</pre>
</div>
</content>
</entry>
<entry>
<title>GitHubCommit: Extract language handling to a function</title>
<updated>2017-08-20T18:40:56+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T18:38:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=0b20b2b113e68396a8ab4e6b59b349dc9248d85b'/>
<id>0b20b2b113e68396a8ab4e6b59b349dc9248d85b</id>
<content type='text'>
Move the CLI option extracting to a new function that moves the option
parsing logic outside the plugin.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the CLI option extracting to a new function that moves the option
parsing logic outside the plugin.
</pre>
</div>
</content>
</entry>
<entry>
<title>GitHubCommit: Make localisation work</title>
<updated>2017-08-20T18:17:30+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T18:17:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=37c39d1267e6211233a98081ddea9fef2a6f05df'/>
<id>37c39d1267e6211233a98081ddea9fef2a6f05df</id>
<content type='text'>
Get the language from the command line options and use it to determine
which localised string to return on error. Wooo!! it works! So cool.

Add French translations for our existing strings.

The code to get the language option is pretty messy for the moment. I
want to factor it out into its own separate function. But at least it's
working now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Get the language from the command line options and use it to determine
which localised string to return on error. Wooo!! it works! So cool.

Add French translations for our existing strings.

The code to get the language option is pretty messy for the moment. I
want to factor it out into its own separate function. But at least it's
working now.
</pre>
</div>
</content>
</entry>
<entry>
<title>CliOptions: Parse the `language` option into a `Locale`</title>
<updated>2017-08-20T18:04:24+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T18:04:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=e1462aecda91b990fe9d2e4531f6986234b84fb4'/>
<id>e1462aecda91b990fe9d2e4531f6986234b84fb4</id>
<content type='text'>
Instead of parsing `--language` as a string, parse it as a real `Locale`
type. This means the parsing is taken care of for us at the CLI option
handling stage instead of later on.

We can thus use the language value more quickly and easily, passing it
to the `translate` function, which takes a `Locale`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of parsing `--language` as a string, parse it as a real `Locale`
type. This means the parsing is taken care of for us at the CLI option
handling stage instead of later on.

We can thus use the language value more quickly and easily, passing it
to the `translate` function, which takes a `Locale`.
</pre>
</div>
</content>
</entry>
<entry>
<title>CliOptions(parseOptions): Return options</title>
<updated>2017-08-20T16:17:54+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T16:17:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=5792fb1fc1439994a4877761820d8d034b66110d'/>
<id>5792fb1fc1439994a4877761820d8d034b66110d</id>
<content type='text'>
Make the parsed options accessible to the rest of the program.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the parsed options accessible to the rest of the program.
</pre>
</div>
</content>
</entry>
<entry>
<title>CliOptions: Add command line option for language</title>
<updated>2017-08-20T15:38:47+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T15:37:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=b8d535020feeea4233306c2063f19c25f383384f'/>
<id>b8d535020feeea4233306c2063f19c25f383384f</id>
<content type='text'>
Provide a way to switch languages when starting the bot.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide a way to switch languages when starting the bot.
</pre>
</div>
</content>
</entry>
<entry>
<title>IRC: Only require "sorbot: " prefix in channels</title>
<updated>2017-08-20T15:28:18+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-20T15:28:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/sorbot/commit/?id=9307d2f5a1531f4a89264207be482cc23382908c'/>
<id>9307d2f5a1531f4a89264207be482cc23382908c</id>
<content type='text'>
When talking with the bot in a private one-to-one query, there's no
reason to use the "sorbot: " prefix because you're not talking to anyone
else. In that case, just behave like we did before and allow users to
send commands with no prefix.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When talking with the bot in a private one-to-one query, there's no
reason to use the "sorbot: " prefix because you're not talking to anyone
else. In that case, just behave like we did before and allow users to
send commands with no prefix.
</pre>
</div>
</content>
</entry>
</feed>
