<commit_before>// Copyright 2016 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package form

import (
	"github.com/GoLangsam/container/oneway/list"
)

// Value sets Element's Value to v.
// and returns it's undo form
func Value(v interface{}) DoFn {
	return func(e *list.Element) DoFn {
		previous := e.Value
		e.Value = v
		return Value(previous)
	}
}<commit_msg>make sample DoFn `Value` more crisp<commit_after>// Copyright 2016 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package form

import (
	"github.com/GoLangsam/container/oneway/list"
)

// Value sets Element's Value to v.
// and returns it's undo function.
func Value(v interface{}) DoFn {
	return func(e *list.Element) (undo DoFn) {
		undo = Value(e.Value) // refer to self
		e.Value = v           // do it
		return                // done
	}
}
{'fraction_non_alphanumeric': 0.11190233977619532, 'fraction_numerical': 0.008138351983723296, 'mean_word_length': 2.9518072289156625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4977392', 'n_tokens_mistral': 327, 'n_tokens_neox': 303, 'n_words': 121}