So for a bit recently, I've been looking into Haskell. I really want to get into some functional programming. On thing I like doing is network programming because it actually gives me something extra to interact with than my own I/O or bugging a friend to help out or check something out. So I gave a quick glance at sockets and wanted to just see what the types look like on ghci, and of course it cannot find anything related to the network package.
After a few minutes of banging my head against my desk, I say screw the gui package manager and just poke around with apt-cache search. Manage to find the library and for some reason, it was not installed by default. So here's what lead me to the package and the quick and easy fix for it.
Then problem solved, hoped over to ghci and it's there.
So yeah, if you run into this, there you go. I think everyone looking into this can probably figure it out on their own, but if not, hopefully this helps. Edited the command stuff to just remove some information and lots of text in between.
> import Network.Socket: Could not find module `Network.Socket': it is not a module in the current program, or in any known package. Leaving GHCi. $ ghc-pkg field network exposed-modules ghc-pkg: cannot find package network
After a few minutes of banging my head against my desk, I say screw the gui package manager and just poke around with apt-cache search. Manage to find the library and for some reason, it was not installed by default. So here's what lead me to the package and the quick and easy fix for it.
$ apt-cache search haskell | grep network libghc6-network-dev - Haskell network library for GHC libghc6-network-doc - Haskell network library for GHC; documentation libghc6-network-prof - Haskell network library for GHC; profiling libraries $ sudo apt-get install libghc6-network-dev
Then problem solved, hoped over to ghci and it's there.
$ ghc-pkg field network exposed-modules exposed-modules: Network Network.BSD Network.Socket.Internal Network.Socket Network.URI $ ghci > :t Network.Socket.socket Network.Socket.socket :: Network.Socket.Internal.Family -> Network.Socket.SocketType -> Network.Socket.ProtocolNumber -> IO Network.Socket.Socket >
So yeah, if you run into this, there you go. I think everyone looking into this can probably figure it out on their own, but if not, hopefully this helps. Edited the command stuff to just remove some information and lots of text in between.