[Haskell-cafe] Using Haskell's FFI to send ancillary data over Unix domain sockets

2010-03-04 Thread ihope
Unix domain sockets are a type of socket created between two programs on a single Unix system. They are useful in part because over them you can send so-called ancillary data: file descriptors and credentials (i.e. a proof of who the process on the other end is). The thing is, Haskell doesn't have

Re: [Haskell-cafe] List operation question

2007-02-05 Thread ihope
On 2/4/07, Eric Olander [EMAIL PROTECTED] wrote: Hi, I'm still somewhat new to Haskell, so I'm wondering if there are better ways I could implement the following functions, especially shiftl: moves the last element to the head of the list shiftl :: [a] - [a] shiftl [] = []

Re: [Haskell-cafe] rebinding = for restricted monads

2006-12-17 Thread ihope
On 12/17/06, David Roundy [EMAIL PROTECTED] wrote: Hello fellow haskellers, I am wondering if anyone has an idea whether I'd run into trouble if I rebound = in order to provide a more restricted monad. My idea is to define a class: . . . which seems rather heavy. Can anyone think of

Re: Re: [Haskell-cafe] beginner's problem about lists

2006-10-10 Thread ihope
On 10/10/06, Nicolas Frisby [EMAIL PROTECTED] wrote: data Fin data Inf data List l a = Cons a (List l a) | Nil It's possible to make both infinite list and finite list datatypes: data Inf a = InfCons a (Inf a) data Fin a = FinCons a !(Fin a) | FinNil At least, I think the Fin type there

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread ihope
On 10/8/06, Yang [EMAIL PROTECTED] wrote: And do most (experienced) Haskell users sacrifice cleanliness for speed, or speed for cleanliness? Keep the internals of your code--that which will be looked at a lot--fast and ugly, while the rest can be clean. If you have a function that does

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread ihope
On 10/8/06, ihope [EMAIL PROTECTED] wrote: Keep the internals of your code--that which will be looked at a lot--fast and ugly, while the rest can be clean. Sorry. Meant that which will be used a lot. ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Defining show for a function type.

2006-07-11 Thread ihope
On 7/10/06, Fritz Ruehr [EMAIL PROTECTED] wrote: Were you interested in seeing the function, you could do so, at least for finite, total functions (you can also enumerate them, compare them for equality, etc.). See my haskell-cafe message at

Re: [Haskell-cafe] Re: Strictness in do block

2006-07-08 Thread ihope
On 7/5/06, John Goerzen [EMAIL PROTECTED] wrote: On 2006-07-05, Duncan Coutts [EMAIL PROTECTED] wrote: evaluate is for just that purpose. evaluate (length input) from the docs: http://haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#v%3Aevaluate That looks like

Re: [Haskell-cafe] help with creating a DAG?

2006-07-08 Thread ihope
On 7/8/06, David Roundy [EMAIL PROTECTED] wrote: Hi all, I'm wanting to create a data structure to hold a directed acyclic graph (which will have patches represented by edges), and haven't yet been able to figure out a nice representation. I'd like one that can be reasoned with recursively, or

Re: [Haskell-cafe] A question about stack overflow

2006-06-29 Thread ihope
for a different reason. How about this: maximum (a:b:xs) = maximum ((: xs) $! max a b) --ihope ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Haskell + Windows API = wuh?

2006-05-02 Thread ihope
? --ihope ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Spawning a terminal window?

2006-04-20 Thread ihope
Does Haskell have a handy way to spawn a new terminal window and give you a handle to access it with? --ihope ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] The case of the missing module

2006-04-15 Thread ihope
In the Haddock source, there's the following line: import Paths_haddock( getDataDir ) Paths_haddock doesn't seem to be anywhere inside the Haddock distribution, and a Google search doesn't turn up any useful results. Where can I find this thing?

[Haskell-cafe] #if and #endif

2006-04-13 Thread ihope
I grabbed the source code to Haddock, but GHC doesn't like the #if's and the #endif's. What can I do with these? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] #if and #endif

2006-04-13 Thread ihope
On 4/13/06, Jason Dagit [EMAIL PROTECTED] wrote: Try using passing -cpp to ghc when you compile. Jason Thanks. Will do. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Ambiguous types for collection keys

2006-04-12 Thread ihope
On 4/12/06, Scott Weeks [EMAIL PROTECTED] wrote: Hello everyone, I've been banging my head against my desk a bit so I figured it's time to ask for help :-) When a user queries I have to read the input from IO and then somehow cast the key/index type without angering the type checker. If I

Re: [Haskell-cafe] Re: Justification for Ord inheriting from Eq?

2006-04-07 Thread ihope
On 4/7/06, Jared Updike [EMAIL PROTECTED] wrote: given an Ord instance (for a type T) a corresponding Eq instance can be given by: instance Eq T where a == b = compare a b == EQ where did this second -^ == come from? (I guess if if Ordering derives Eq :-) I think you meant

Re: [Haskell-cafe] Re: [Haskell] What's up with this Haskell runtime error message:

2006-04-05 Thread ihope
On 4/5/06, Michael Goodrich [EMAIL PROTECTED] wrote: Looks like my calulation involves a self referential set of definitions. Is Haskell not able to deal with a self referential set of definitions? Yes, it is, but not if that definition doesn't evaluate to a proper value. For example: main =

Re: [Haskell-cafe] Re: Positive integers

2006-04-01 Thread ihope
On 3/29/06, Aaron Denney [EMAIL PROTECTED] wrote: (And yes, we desperately need something like class aliases.) You mean like this? class Foo a b where foo :: a - b class Foo a b = Bar a b where instance Foo a b = Bar a b where This will make every instance of Foo one of Bar, and make sure

Re: [Haskell-cafe] Re: Positive integers

2006-03-28 Thread ihope
On 3/24/06, Henning Thielemann [EMAIL PROTECTED] wrote: A new type, say Cardinal as in Modula, would document for the user of a function that only non-negative numbers are allowed and the function writer can be sure, that only non-negative numbers are passed. ... newtype Cardinal =

Re: [Haskell-cafe] Re: Equirecursive types?

2006-03-28 Thread ihope
On 3/27/06, lee marks [EMAIL PROTECTED] wrote: So this is legal: type Fix s a = s a (Fix s a) fold :: Functor (s a) = (s a b - b) - Fix s a - b fold f = f . fmap (fold f) but this is not: fold f = f . fmap (fold f) data Fix s a = Fix {runFix :: s a (Fix s a)} fold :: Functor (s

[Haskell-cafe] A syntax proposal: data replacements

2006-03-08 Thread ihope
I'd like to propose more syntactic sugar more Haskell. (A spoonful of syntactic sugar makes the medicine go down...) Put simply, this would provide a smallish bit of pattern matching, and hopefully clarify some things. A simple example should pretty much define the whole thing: fromJust = {Just

[Haskell-cafe] My piece of an IRC bot

2006-02-28 Thread ihope
Today I started on a simple IRC bot framework thingy. I decided to post the source code here so people can look at it and tell me what the heck I did wrong :-P module IRC where import Control.Monad.State import System.IO import Network