Hi.
Working on a Haskell binding for BrlAPI.
The following example works:
module Main where
import Control.Monad (void)
import BrlAPI
main :: IO ()
main = withConnection "" ":0" $ \c -> do
dn <- getDriverName c
mi <- getModelIdentifier c
(x, _) <- getDisplaySize c
withTty c (Just 5) False $ \tty -> do
writeText c (show (tty, dn, mi, x))
void $ readKey c
Reading the docs again, I am unsure if I want to mimick the low-level
API as much as I usually would. I think it would be better to have a
different type of handle for ttyMode operations. IOW, return some
handle from enterTtyMode and make writeText and friends use that.
This would make the sort of error the docs are talking about impossible,
and that is pretty much the spirit of type-safe FP.
Let me know if you see a big no-no here, otherwise I'll proceed.
--
CYa,
⡍⠁⠗⠊⠕
_______________________________________________
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: [email protected]
For general information, go to: http://brltty.app/mailman/listinfo/brltty