summaryrefslogtreecommitdiff
path: root/dht/examples
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2020-01-05 20:03:18 -0500
committerJoe Crayne <joe@jerkface.net>2020-01-05 21:44:36 -0500
commit62d31ca46fb3143af3004730195ff6554cf3fa40 (patch)
treea2882c330ba580ef57ecbf62b999ae87d377e35d /dht/examples
parent6047a311f270bbb0a176900d9b1fea5e6d9b96c1 (diff)
Forward port to GHC 8.10.1-alpha2 (83edba07e4)
Diffstat (limited to 'dht/examples')
-rw-r--r--dht/examples/dht.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/dht/examples/dht.hs b/dht/examples/dht.hs
index 3e1b1656..6615477b 100644
--- a/dht/examples/dht.hs
+++ b/dht/examples/dht.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE NondecreasingIndentation #-} 2{-# LANGUAGE NondecreasingIndentation #-}
2import Control.Applicative 3import Control.Applicative
3import Control.Monad 4import Control.Monad
@@ -13,6 +14,10 @@ import System.IO
13import System.IO.Unsafe 14import System.IO.Unsafe
14import qualified Data.ByteString as B 15import qualified Data.ByteString as B
15 16
17#if MIN_VERSION_haskeline(0,8,0)
18import Control.Exception (handle)
19#endif
20
16-- | Reads one character. If it is not a digit, 21-- | Reads one character. If it is not a digit,
17-- then it is discarded and 'Nothing' is returned. 22-- then it is discarded and 'Nothing' is returned.
18hReadDigit :: Handle -> IO (Maybe Char) 23hReadDigit :: Handle -> IO (Maybe Char)