Skip to content

Commit

Permalink
doc: cleanup markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Apr 22, 2024
1 parent 98e7893 commit bc40fe4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Extism/HostFunction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -226,22 +226,22 @@ hostFunctionWithNamespace' ns name params results f v =
nparams = fromIntegral $ length params
nresults = fromIntegral $ length results

-- | 'hostFunction "function_name" inputTypes outputTypes callback userData' creates a new
-- | 'Function' in the default namespace that can be called from a 'Plugin'
-- | @hostFunction "function_name" inputTypes outputTypes callback userData@ creates a new
-- | 'Extism.Function' in the default namespace that can be called from a 'Extism.Plugin'
hostFunction :: String -> [ValType] -> [ValType] -> (CurrentPlugin -> a -> IO ()) -> a -> IO Function
hostFunction = hostFunctionWithNamespace' Nothing

-- | 'hostFunction' "namespace" "function_name" inputTypes outputTypes callback userData' creates a new
-- | 'Function' in the provided namespace that can be called from a 'Plugin'
-- | @hostFunction' "namespace" "function_name" inputTypes outputTypes callback userData@ creates a new
-- | 'Extism.Function' in the provided namespace that can be called from a 'Extism.Plugin'
hostFunction' :: String -> String -> [ValType] -> [ValType] -> (CurrentPlugin -> a -> IO ()) -> a -> IO Function
hostFunction' ns = hostFunctionWithNamespace' (Just ns)

-- | 'newFunction "function_name" inputTypes outputTypes callback userData' creates a new
-- | 'Function' in the default namespace that can be called from a 'Plugin'
-- | @newFunction' "function_name" inputTypes outputTypes userData callback@ creates a new
-- | 'Extism.Function' in the default namespace that can be called from a 'Extism.Plugin'
newFunction :: String -> [ValType] -> [ValType] -> a -> (CurrentPlugin -> a -> IO ()) -> IO Function
newFunction name params results x f = hostFunctionWithNamespace' Nothing name params results f x

-- | 'newFunction' "namespace" "function_name" inputTypes outputTypes callback userData' creates a new
-- | 'Function' in the provided namespace that can be called from a 'Plugin'
-- | @newFunction' "namespace" "function_name" inputTypes outputTypes userData callback@ creates a new
-- | 'Extism.Function' in the provided namespace that can be called from a 'Extism.Plugin'
newFunction' :: String -> String -> [ValType] -> [ValType] -> a -> (CurrentPlugin -> a -> IO ()) -> IO Function
newFunction' ns name params results x f = hostFunctionWithNamespace' (Just ns) name params results f x

0 comments on commit bc40fe4

Please sign in to comment.