I think you can achieve what you want but you need to use the correct
types for it. Remember that when you write:
getFilterMainStuff :: Deliverable a = FilePath - Interpreter (Path,
Filter a)
the proper way to read the signature is the caller of
getFilterMainStuff is entitled to pick the
Thanks so much, I think I understand. This definitely sounds like what I
want to do. I guess I've got some learning to do...
Thats why I love Haskell so much, every other day it gives me something
new to learn.
Thanks again,
/Joe
Daniel Gorín wrote:
I think you can achieve what you want
I've been working on a little project, and one of the things I need to
do is dynamically compile and import a Haskell Source file containing
filtering definitions. I've written a small monad called Filter which is
simply:
type Filter a = Reader (Config, Email) a
To encompass all the email
Am Donnerstag, 5. März 2009 19:48 schrieb Joseph Fredette:
getFilterMain :: Deliverable a = FilePath - Interpreter (Filter
a)
getFilterMain fMainLoc =
do
loadModules [fMainLoc]; setTopLevelModules [(takeWhile
(/='.') fMainLoc)]
fMain - (interpret
This doesn't seem to do it, same type error... Maybe I need to use some
kind of witness type -- to inform the compiler
of the type of a @ runtime?
Daniel Fischer wrote:
Am Donnerstag, 5. März 2009 19:48 schrieb Joseph Fredette:
getFilterMain :: Deliverable a = FilePath - Interpreter
So, by using the Haskell interpreter, you're using the
not-very-well-supported dynamically-typed subset of Haskell. You can
tell this from the type signature of interpret:
interpret :: Typeable a = String - a - Interpreter a
as :: Typeable a = a
as = undefined
(from
So, I tried both of those things, both each alone and together. No dice.
Same error, so I reverted back to the
original. :(
However, I was, after some random type signature insertions, able to
convert the problem into a different one, via:
getFilterMain :: Deliverable a = FilePath -
Hi
I've downloaded Hackmain from patch-tag, but I'm getting a different
error. The error I get is:
Hackmain.hs:63:10:
No instance for (Data.Typeable.Typeable2
Control.Monad.Reader.Reader)
arising from a use of `interpret' at Hackmain.hs:63:10-67
Hint
Oh, crap- I must have never pushed the latest patches, I did put the
typeable instances in all the appropriate places. And provided a (maybe
incorrect? Though I'm fairly sure that shouldn't affect the bug I'm
having now) Typeable implementation for Reader, but I still get this
ambiguous type.
Ok, so I've pulled the latest version and the error I get now is:
Hackmain.hs:70:43:
Ambiguous type variable `a' in the constraint:
`Deliverable a'
arising from a use of `getFilterMainStuff' at Hackmain.hs:
70:43-60
Probable fix: add a type signature that fixes these type
10 matches
Mail list logo