jspahrsummers/documentalist — pull request #46 by maxpow4h (2013-09-26 09:44:33+00:00)
Title: Haskell type information unification

:warning: WIP :warning:
Say you have the declaration:
```objc
/// some comments
- (RACTuple *)divideWithAmount:(RACSignal
*)sliceAmountSignal fromEdge:(NSLayoutAttribute)edgeAttribute;
```

Yet you have [another library](https://github.com/maxpow4h/hrac) written in Haskell that has extra type information about that function.

With this, you can parse the Haskell file and add Haskell's type information about that function to the objective-c's docblock.

I.e.

```hs
p_hs <- runHaskellParser $ parseHS "Fixtures/RCL.hs"
p_rac <- runClangParser $ parse "Fixtures/test_header.h"
let c_rac = parseDocs TomDocParser p_rac
c_rac' = p_hs ~> c_rac
```

will parse:
```hs
divideWithAmount_fromEdge :: TypeLC t
=> Func (RACSignal CGRect)
-> Func (RACSignal CGRect)
-> NSLayout
-> Bind t TTrue (RACSignal CGSize)
-> OM (Bind Local TTrue (RACTuple (RACSignal CGSize) (RACSignal CGSize)))
```

and produce:

# Description:
```
Func (RACSignal (CGRect)) -> Func (RACSignal (CGRect)) -> NSLayout -> Bind (t) (TTrue) (RACSignal (CGSize))
-> OM (Bind (Local) (TTrue) (RACTuple (RACSignal (CGSize)) (RACSignal (CGSize))))
```
) `-divideWithAmount:fromEdge:` (InstanceMethod [`id`]) [DecLeaf (Left (CommentParseException
{file = Nothing, line = Nothing, message = "Comment not found"}))
`sliceAmountSignal` (Parameter (Just `id`)),
DecLeaf (Left (CommentParseException {file = Nothing, line = Nothing, message = "Comment not found"})) `edgeAttribute` (Parameter (Just `id`))