Homework-New/milestone_1_ashish.md

28 lines
2.0 KiB
Markdown

Hey, thank you for taking a look! I'll try answer your questions:
__Q__: I had a question about why MonadReader was preferred over ReaderT?
__A__: `ReaderT` is actually an instance of `MonadReader`! The difference, though, is that the types are kind of simplified. Instead of having to write `ReaderT [Term] ... a`, we just write `m a`. This also allows us to add additional effects to the monad without changing the type signature. For instance, none of the code would change if we wanted to add a state effect via `StateT s`, because the signatures only require constraints on the types, rather than specifying what the types are.
__Q__: I had a question about how instances for this monad were created.
__A__: Check out [`LoadingImpl`](https://web.engr.oregonstate.edu/~fedorind/CS583/modules/loadingimpl/), which contains a `PathT` monad transformer which implements `MonadModulePath`. I defined it as a `newtype`
around a `ReaderT` because you can't have two of the same tranformer in the same monad transformer
stack, and I didn't want `PathT` to interfere with other `ReaderT`s in the API.
__Q__: As you rightly mentioned bundling an environment for all operations is a viable option, please let me know if the operations are then stored in a stack format?
__A__: Our functions would be kept in a `Map String Definition` or something of that sort. The lookups
would not be linear time, but probably logarithmic, if that's what you're wondering about.
__Q__: Kindly let me know if you are referring to type equality?
__A__: Well, we are referring to type equality, but within our _object language_ (Maypop), and nor
our metalanguage (_Haskell_). Although the library you linked would help with equality of _Haskell_
types, it wouldn't help us with _Maypop_.
__Q__: I think using some kind of plugin for haskell might help in doing tactics.
__A__: It would if we were trying to add tactics to Haskell, but we're trying to add tactics to
Maypop. We have full control of the language; the real question is, what will our design be like?