Hello Shannon,
Thursday, March 9, 2006, 1:19:39 AM, you wrote:
>> I'd use a State-monad, say
SjB> I suspect you guys are right. I had always thought of states as
SjB> being "isomorphic" to integers (i.e. you can be in state 0, state 1,
SjB> ... state n), not as contexts (you have this input, th
> Dude, that was a friggin' awesome email! I'm trying to figure out how
> I can just copy it wholesale into the article ;)
Use what you need. Share and share alike.
> I've been struggling
> with Haskell for long enough that my knowledge is now snowballing
> downhill.
I think I experienced that
On 3/8/06, Shannon -jj Behrens <[EMAIL PROTECTED]> wrote:
> On 3/8/06, Jared Updike <[EMAIL PROTECTED]> wrote:
> > > I suspect you guys are right. I had always thought of states as
> > > being "isomorphic" to integers (i.e. you can be in state 0, state 1,
> > > ... state n), not as contexts (you h
On 3/8/06, Jared Updike <[EMAIL PROTECTED]> wrote:
> > I suspect you guys are right. I had always thought of states as
> > being "isomorphic" to integers (i.e. you can be in state 0, state 1,
> > ... state n), not as contexts (you have this input, that output, and
> > this token stack), am I wrong
> I suspect you guys are right. I had always thought of states as
> being "isomorphic" to integers (i.e. you can be in state 0, state 1,
> ... state n), not as contexts (you have this input, that output, and
> this token stack), am I wrong?
You're thinking of a state machine, I think, which is no
First of all, thank you all so much for taking the time to help me
with this exercise! My hope is that once I'm able to understand it,
my understanding can come through in the article I write.
> Brian Hulley:
> In the pipe in the 'otherwise' branch, at the moment you have to
> assume that each of
Am Dienstag, 7. März 2006 20:52 schrieb Shannon -jj Behrens:
> I did think of using a monad, but being relatively new to Haskell, I
> was confused about a few things. Let's start by looking at one of my
> simpler functions:
>
> -- Keep pushing tokens until we hit an identifier.
> pushUntilIdentifi
Hello Shannon,
Tuesday, March 7, 2006, 10:52:01 PM, you wrote:
SjB> The function itself is a ParseContextTransformation. It takes a
SjB> context, transforms it, and returns it. Most of the pipelines in the
SjB> whole application are ParseContextTransformations, and the |> (or $ or
SjB> .) are w
Shannon -jj Behrens wrote:
I did think of using a monad, but being relatively new to Haskell, I
was confused about a few things. Let's start by looking at one of my
simpler functions:
-- Keep pushing tokens until we hit an identifier.
pushUntilIdentifier :: ParseContextTransformation
pushUntilI
I did think of using a monad, but being relatively new to Haskell, I
was confused about a few things. Let's start by looking at one of my
simpler functions:
-- Keep pushing tokens until we hit an identifier.
pushUntilIdentifier :: ParseContextTransformation
pushUntilIdentifier ctx
| currTokType
Brian Hulley wrote:
translate :: (Monad m) => String -> m String
translate = do
createParseContext
readToFirstIdentifier
dealWithDeclarator
consolidateOutput
The type signature above doesn't match the do blo
On Mon, 2006-03-06 at 11:25 -0800, Shannon -jj Behrens wrote:
. . .
> I find "ctx |> currTok |> tokenType" to be more readable than
> "tokenType $ currTok $ ctx" because you're not reading the code in
> reverse. That's my primary complaint with "." and "$". That's
> especially the case when I'
Shannon -jj Behrens wrote:
> I find "ctx |> currTok |> tokenType" to be more readable than
> "tokenType $ currTok $ ctx" because you're not reading the code in
> reverse. That's my primary complaint with "." and "$".
Seconded. That's why I'd like to see the arguments to (.) swapped, but
it's too
Shannon -jj Behrens wrote:
I find "ctx |> currTok |> tokenType" to be more readable than
"tokenType $ currTok $ ctx" because you're not reading the code in
reverse. That's my primary complaint with "." and "$". That's
especially the case when I'm spreading the code over multiple lines:
-- Tran
By the way, thanks for everyone's comments so far! They're very helpful!
> Also, most haskell programs use $ instead of |>
>
> > -- For convenience:
> > currTokType :: ParseContext -> TokenType
> > currTokType ctx = ctx |> currTok |> tokenType
>
> this could be written as:
> tokenType $ currTok $
15 matches
Mail list logo