Difference between revisions of "User:JRV"

From HaskellWiki
Jump to navigation Jump to search
(Added special characters!)
Line 1: Line 1:
  +
Since I'm new to this, I'm trying out the beginings of a tutorial here on my user page.
== Testing MediaWiki markup==
 
   
  +
----
I'm new at this, and I thought I'd use this page to test some things I want to use in
 
  +
There is some interest in using Haskell on the Mac with a real Mac (Aqua)
a Wiki article.
 
  +
interface. There are a couple of things out there which are mentioned on
  +
the [[Missing_tutorials | Missing tutorials]] page. My adventures with, or
  +
reading about, these left me in need of the missing tutorial, rather than
  +
the ability to write one. But that's another topic.
   
  +
This tutorial doesn't meet the needs of the Missing tutorial page. It is
First, can I can compose offline with MacVim
 
  +
much less ambitious.
and paste into my user page. The answer to this is yes.
 
   
  +
It assumes you know something about Xcode, and something about Haskell.
== Some Haskell code==
 
  +
Its not an objective-c bridge. But it does seem to provide a simple way to
  +
incorporate a Haskell model doing the heavy computation into a Cocoa
  +
application.
   
  +
This is rudimentary, and more work needs to be done, but I decided to put
Following is produced using <pre><haskell>...</haskell></pre> gets haskell highlighting.
 
  +
this out before spending a lot of time on polishiing. The section "To do"
How do I get highlighting for, say, C?
 
  +
lists things I can think of to add to this tutorial, some hard, some easy.
   
  +
== Why? ==
 
  +
== Overview ==
<haskell>
 
 
== Compile Haskell module ==
{-# LANGUAGE ForeignFunctionInterface #-}
 
  +
== Import into Xcode project ==
 
  +
== Compile and run ==
module Safe where
 
  +
== To do ==
 
import Foreign.C.Types
 
 
fibonacci :: Int -> Int
 
fibonacci n = fibs !! n
 
where fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
 
 
fibonacci_hs :: CInt -> CInt
 
fibonacci_hs = fromIntegral . fibonacci . fromIntegral
 
 
foreign export ccall fibonacci_hs :: CInt -> CInt
 
 
</haskell>
 
 
== Some misc text ==
 
 
Here is some ''italic'' text.
 
 
== Special symbols ==
 
 
Well, I should be able to do this in vim, I'll try later
 
when I have time.
 
 
It's not vim, but here is the OS X Character pallet:
 
 
em dash: —
 
 
“ quotation marks ”
 
 
==Links to other pages==
 
The place that got me started toward this is [[Calling_Haskell_from_C| Calling Haskell from C]].
 

Revision as of 20:24, 16 October 2009

Since I'm new to this, I'm trying out the beginings of a tutorial here on my user page.


There is some interest in using Haskell on the Mac with a real Mac (Aqua) interface. There are a couple of things out there which are mentioned on the Missing tutorials page. My adventures with, or reading about, these left me in need of the missing tutorial, rather than the ability to write one. But that's another topic.

This tutorial doesn't meet the needs of the Missing tutorial page. It is much less ambitious.

It assumes you know something about Xcode, and something about Haskell. Its not an objective-c bridge. But it does seem to provide a simple way to incorporate a Haskell model doing the heavy computation into a Cocoa application.

This is rudimentary, and more work needs to be done, but I decided to put this out before spending a lot of time on polishiing. The section "To do" lists things I can think of to add to this tutorial, some hard, some easy.

Why?

Overview

Compile Haskell module

Import into Xcode project

Compile and run

To do