Skip to content

Commit

Permalink
Delete some dead, commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
dolio committed Jan 15, 2025
1 parent b649776 commit 85feecc
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions unison-runtime/src/Unison/Runtime/Foreign/Function.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1706,46 +1706,6 @@ instance ForeignConvention POSIXTime where
readAtIndex stk i = fromIntegral <$> peekOffI stk i
writeBack stk pt = pokeI stk (round pt)


-- mkForeignExn ::
-- ForeignArgs a =>
-- ForeignConvention e =>
-- ForeignConvention r =>
-- (a -> IO (Either (Failure e) r)) ->
-- ForeignFunc
-- mkForeignExn f = FFE f

-- TODO: was this ever actually used? Mapping IO exceptions to numbers.
--
-- ioeDecode :: Int -> IOErrorType
-- ioeDecode 0 = AlreadyExists
-- ioeDecode 1 = NoSuchThing
-- ioeDecode 2 = ResourceBusy
-- ioeDecode 3 = ResourceExhausted
-- ioeDecode 4 = EOF
-- ioeDecode 5 = IllegalOperation
-- ioeDecode 6 = PermissionDenied
-- ioeDecode 7 = UserError
-- ioeDecode _ = internalBug "ioeDecode"

-- ioeEncode :: IOErrorType -> Int
-- ioeEncode AlreadyExists = 0
-- ioeEncode NoSuchThing = 1
-- ioeEncode ResourceBusy = 2
-- ioeEncode ResourceExhausted = 3
-- ioeEncode EOF = 4
-- ioeEncode IllegalOperation = 5
-- ioeEncode PermissionDenied = 6
-- ioeEncode UserError = 7
-- ioeEncode _ = internalBug "ioeDecode"

-- instance ForeignConvention IOException where
-- readForeign = readForeignAs (bld . ioeDecode)
-- where
-- bld t = IOError Nothing t "" "" Nothing Nothing
--
-- writeForeign = writeForeignAs (ioeEncode . ioe_type)

decodeBufferMode :: Closure -> IO BufferMode
decodeBufferMode (Enum _ t)
| t == TT.noBufTag = pure NoBuffering
Expand Down

0 comments on commit 85feecc

Please sign in to comment.