You find point I need the correct type signatures.
Haisheng Wu <freizl@gmail.com> wrote:Yes, it's possible using Kleisli, but it's not very convenient, because
> I'm wondering if it is possible doing IO in terms of Arrow.
> I got a function search all files under directory recursively and
> I'd like to refartoring using Arrow terms.
you need the Kleisli wrapper around everything. Also usually there is
really little reason to do that, because monads are more expressive.
For example they allow you to encode computations with only outputs
directly, without wrapping them in a computation, which takes a stub
argument.
No, the needed instances are already there, but you need to change your
> I tried to define a function like below but failed.
> isDirExist = Kleisli doesDirectoryExist
>
> Do I need to define a instance for IO to be Arrow? Or is there any
> existing solutions?
type signatures:
myGetFilesInDir :: Kleisli FilePath [FilePath]
Greets,
Ertugrul
--
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners